From owner-freebsd-hackers Thu Jan 13 4: 5: 8 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from pcnet1.pcnet.com (pcnet1.pcnet.com [204.213.232.3]) by hub.freebsd.org (Postfix) with ESMTP id 8529714C24 for ; Thu, 13 Jan 2000 04:05:05 -0800 (PST) (envelope-from eischen@vigrid.com) Received: (from eischen@localhost) by pcnet1.pcnet.com (8.8.7/PCNet) id HAA03880; Thu, 13 Jan 2000 07:05:00 -0500 (EST) Date: Thu, 13 Jan 2000 07:05:00 -0500 (EST) From: Daniel Eischen Message-Id: <200001131205.HAA03880@pcnet1.pcnet.com> To: freebsd-hackers@FreeBSD.ORG, lists@security.za.net Subject: Re: Pthreads Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > Quick question, > > Does anyone on here know what the equivelant macro for > PTHREAD_RECURSIVE_MUTEX_INITALIZER_NP is under freebsd? I cant find > anything like this in pthread.h, and Im wondering without it what do I use > to initialize a recursive mutex. > > Any advice would be appreciated Well, the '_NP' in PTHREAD_RECURSIVE_MUTEX_INITALIZER_NP should give you some idea. Hint: Non-portable. There is no PTHREAD_RECURSIVE_MUTEX_INITALIZER_NP in the POSIX standard, and one shouldn't rely on its use. Recursive mutexes can be easily done by the application, just by wrapping them in a structure with an owner and count. That said, SUSv2 does provide a recursive mutex (unlike POSIX). To use a recursive mutex under FreeBSD, use: pthread_mutex_settype(PTHREAD_MUTEX_RECURSIVE); Dan Eischen eischen@vigrid.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message