Re: Hurd_condition_wait in glibc libpthreads in Debian
On Wed, Aug 01, 2012 at 08:44:20AM -0700, Thomas DiModica wrote:
> Most of what I understand is from what Marcus has to say in this thread here:
That link explains the problem very well. It's better to keep the
current calls to hurd_condition_wait (i.e. through plain error handling)
than try to replace that with complicated cleanup callbacks.
> My understanding is that hurd_condition_wait is used with hurd_thread_cancel
> in libc, as libc uses a different cancellation semantics than is provided by
> POSIX in pthreads.
No, the semantics are the same. The internal implementation may slightly
differ, I haven't looked in detail. The point is how to handle
cancellation from a cancelled thread, not how to mark a thread as being
cancelled. The hurd_thread_cancel function merely exists because there
isn't any in the cthreads package. You should be able to replace it with
pthread_cancel without further effort.