From owner-cvs-all@FreeBSD.ORG Fri Jan 16 20:49:23 2004 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5D08E16A4CE; Fri, 16 Jan 2004 20:49:23 -0800 (PST) Received: from bento.FreeBSD.org (bento.freebsd.org [216.136.204.23]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7D1F643D5A; Fri, 16 Jan 2004 20:49:22 -0800 (PST) (envelope-from davidxu@freebsd.org) Received: from freebsd.org (localhost [127.0.0.1]) by bento.FreeBSD.org (8.12.10/8.12.10) with ESMTP id i0H4nDfx039198; Fri, 16 Jan 2004 20:49:14 -0800 (PST) (envelope-from davidxu@freebsd.org) Message-ID: <4008BEBB.7040408@freebsd.org> Date: Sat, 17 Jan 2004 12:48:59 +0800 From: David Xu User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5b) Gecko/20030723 Thunderbird/0.1 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Daniel Eischen References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: cvs-src@freebsd.org cc: src-committers@freebsd.org cc: cvs-all@freebsd.org Subject: Re: cvs commit: src/lib/libc/gen sem.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Jan 2004 04:49:23 -0000 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