--- Jon Keating <[EMAIL PROTECTED]> wrote: > OK, well wouldn't it be easiest to just lock the > event queue and unlock it > after the event is sent? That way all threads are > blocked on the mutex until > the event is sent.
Yes that is the solution, but see below. > Well, isn't that what pthread_setcanceltype is for? > So you can defer > cancellation signals until it is able to receive > them (pthread_tescancel)? Even if we pthread_testcancel, it is still possible that the event is deleted right after pthread_testcancel but before it is derefernced. So the code needs to set pthread_setcancelstate(PTHREAD_CANCEL_ASYNCHRONOUS) which requires it to be very careful since few functions can be called when it is in that state. Furthermore the current code doesn't enable cancellation until after dereferencing the event and sometimes it dereferences the event while holding a mutex, so the solution is to have a cancellation handler which will unlock the used mutexes. __________________________________________________ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Licq-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/licq-devel
