This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: 1.5.10: Problem with SIGEV_THREAD
- From: Bob Cousins <bobcousins34 at hotmail dot com>
- To: cygwin at cygwin dot com
- Date: Thu, 1 Jul 2004 14:42:37 +0000 (UTC)
- Subject: Re: 1.5.10: Problem with SIGEV_THREAD
- References: <loom.20040630T190035-117@post.gmane.org>
Bob Cousins <bobcousins34 <at> hotmail.com> writes:
>
> I am having a problem with timer notifications using SIGEV_THREAD. I adapted
> the sigev_thread.c program from
> http://homepage.mac.com/dbutenhof/Threads/source.html to illustrate problem.
The problem appears to be related to the timer thread terminating. The problem
also occurs if you use non-timer thread. The attached program illustrates this.
If you run it and repeatedly press "return" it usually (not always) hangs when
the child thread exits.
------------------------------------------
#include <stdio.h>
#include <pthread.h>
void *
athread (void *arg)
{
sleep (1);
printf ("exit\n");
return NULL;
}
int count;
main()
{
char cmd [1024];
char *pcmd;
pthread_t id;
pthread_create (&id, NULL, athread, NULL);
printf ("test>");
while (1)
{
pcmd = gets (cmd);
if (pcmd == NULL)
{
printf ("pcmd = NULL\n");
}
else
{
printf ("test> %d",++count);
}
}
return 0;
}
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/