🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.mac.programmer.codewarrior
Article #967

Re: Mutex

#967
From: David M. Palmer
Date: Sun, 23 Jun 2002 21:29
23 lines
1858 bytes
In article <3d15d1c0$1_2@aeinews.>, William A. McKee <wamckee@msn.com>
wrote:

> How do you guarantee mutual exclusion with an Apple API or PowerPlant.  I
> have an ISR that gets called by Open Transport and I don't want collisions
> when accessing the same data when handling the ISR routine.

Under OS X, you can use the POSIX mutex libraries:

% man -k mutex
pthread_mutex_destroy(3) - free resources allocated for a mutex
pthread_mutex_init(3)    - create a mutex
pthread_mutex_lock(3)    - lock a mutex
pthread_mutex_trylock(3) - attempt to lock a mutex without blocking
pthread_mutex_unlock(3)  - unlock a mutex
pthread_mutexattr_init(3), pthread_mutexattr_destroy(3),
pthread_mutexattr_setprioceiling(3),
pthread_mutexattr_getprioceiling(3), pthread_mutexattr_setprotocol(3),
pthread_mutexattr_getprotocol(3), pthread_mutexattr_settype(3),
pthread_mutexattr_gettype(3) - mutex attribute operations

-- 
David M. Palmer  dmpalmer@email.com (formerly @clark.net, @ematic.com)
Technical Details
Message-ID: <230620021529203183%dmpalmer@email.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-post-01!supernews.com!corp.supernews.com!dmpalmer

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10bcce,645725385a3894f7,start
X-Google-Attributes: gid10bcce,public
X-Google-Thread: f635e,645725385a3894f7,start
X-Google-Attributes: gidf635e,public
X-Google-ArrivalTime: 2002-06-23 14:29:21 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-post-01!supernews.com!corp.supernews.com!dmpalmer
From: "David M. Palmer" <dmpalmer@email.com>
Newsgroups: comp.sys.mac.programmer.codewarrior,codewarrior.mac
Subject: Re: Mutex
Date: Sun, 23 Jun 2002 15:29:20 -0600
Organization: Posted via Supernews, http://www.supernews.com
Message-ID: <230620021529203183%dmpalmer@email.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-transfer-encoding: 8bit
User-Agent: Thoth/1.5.4 (Carbon/OS X)
X-Complaints-To: newsabuse@supernews.com
Lines: 23