1.5.10: Problem with SIGEV_THREAD
Bob Cousins
bobcousins34@hotmail.com
Thu Jul 1 14:42:00 GMT 2004
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/
More information about the Cygwin
mailing list