public inbox for pthreads-win32@sourceware.org
 help / color / mirror / Atom feed
* cancelling a thread blocked in pthread_cond_wait
@ 1999-06-30 10:35 Lorin Hochstein
  0 siblings, 0 replies; only message in thread
From: Lorin Hochstein @ 1999-06-30 10:35 UTC (permalink / raw)
  To: pthreads mailing list

In my code, I've encountered the following error:

Thread A is cancelled while blocked in pthread_cond_wait. The thread
cleans up and exits.

Thread B enters pthread_cond_wait on the same condition. variable

Thread C calls pthread_cond_broadcast, and blocks inside the function.
If I examine the contents of the pthread_cond_t structure (just before I
call pthread_cond_broadcast), I notice that the "waiters" field is set
to 2! So, even though Thread A was cancelled, it is still registered as
waiting for the condition.

Looking through the pthreads code, I cannot see where the "waiters"
field would be decremented in the event that a cancellation occurs while
blocked in pthread_cond_wait.

Am I missing something fundamental here?


Lorin Hochstein

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1999-06-30 10:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-06-30 10:35 cancelling a thread blocked in pthread_cond_wait Lorin Hochstein

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).