|
From: Nicholas N. <n.n...@gm...> - 2009-03-25 01:21:01
|
I'm getting reasonable often failures in none/tests/pth_cvsimple.c.
It has a comment:
// Nb: it's not certain that we'll hit here. It's possible that the two
// inc_count threads could fully run before watch_count begins, and so
// pthread_cond_wait() is never called. Or, we could get a spurious
// wake-up in watch_count(). Nonetheless, it's very likely that things
// will work out as expected, since we're starting watch_count() first.
if (condvar_was_hit == 1)
printf("condvar was hit!\n");
else if (condvar_was_hit > 1)
printf("condvar was multi-hit...\n");
else
printf("condvar was missed...\n");
Any suggestions on how to improve this unreliability? Could a sleep()
call be inserted? Should the output string not depend on the
condvars?
Nick
|