Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 17 Jan 2004 12:48:59 +0800
From:      David Xu <davidxu@freebsd.org>
To:        Daniel Eischen <eischen@vigrid.com>
Cc:        cvs-all@freebsd.org
Subject:   Re: cvs commit: src/lib/libc/gen sem.c
Message-ID:  <4008BEBB.7040408@freebsd.org>
In-Reply-To: <Pine.GSO.4.10.10401162249170.14441-100000@pcnet5.pcnet.com>
References:  <Pine.GSO.4.10.10401162249170.14441-100000@pcnet5.pcnet.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Daniel Eischen wrote:

>On Fri, 16 Jan 2004, David Xu wrote:
>
>  
>
>>davidxu     2004/01/16 18:45:37 PST
>>
>>  FreeBSD src repository
>>
>>  Modified files:
>>    lib/libc/gen         sem.c 
>>  Log:
>>  Enable cancellation point in sem_wait, it is required by POSIX.
>>  For pshared semaphore, this commit still does not enable cancellation
>>  point, I think there should be a pthread_enter_cancellation_point_np
>>  for libc to implement a safe cancellation point.
>>    
>>
>
>Hmm, I'd rather have the threads library provide cancellation
>wrappers for those functions (like the other functions in libc).
>
>  
>
I think you either need to reimplement it in libkse or just let libc to 
do so,
because it uses conditional variable and mutex, when it is cancelled, it 
needs to unlock mutex
and restore waiter counter, a simple wrapper won't work without 
corrrupting it's internal state.

David Xu




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4008BEBB.7040408>