Re: OSX callback, is this OK?
Re: OSX callback, is this OK?
- Subject: Re: OSX callback, is this OK?
- From: Paul Davis <email@hidden>
- Date: Tue, 18 Jan 2011 20:17:14 -0500
On Tue, Jan 18, 2011 at 7:51 PM, Brian Willoughby <email@hidden> wrote:
Look for functions
> semaphore_create(), semaphore_timedwait(), and semaphore_destory() for your
> main program. Inside the CoreAudio callback, you would only call
> semaphore_signal(). In fact, your global/instance variable should be of
> type semaphore_t for this particular solution.
its possible that as you look for this that you will run into the
POSIX semaphore API. the calls that Brian mentioned are part of the
Mach API (which became part of the Darwin API). the POSIX API in this
case consists primarily of
sem_init/sem_open/sem_post/sem_wait/sem_timedwait/sem_destroy.
its important to note that you MUST use either the Mach semaphore_*
API (as Brian mentioned) or if you use the POSIX API be very careful
that you do not use the POSIX sem_init call.
i recently ran into teh crazyee: despite the fact that Apple provided
the POSIX semaphore API nearly a decade ago, the sem_init() call
exists but does nothing! you can still use the rest of the API if you
use sem_open() optionally followed by sem_unlink(). the Mach API is at
a lower level and isn't portable to any other platform, but i suspect
this doesn't bother most people on this list.
--p
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden