views:

188

answers:

2

Is there an equivalent of the .NET ManualResetEvent class available for use in Objective-C / Cocoa?

+5  A: 

I'm not very familiar with ManualResetEvent, but based on the documentation, it looks like the NSCondition class might be what you are looking for.

NSCondition is by no means an exact equivalent, but it does provide similar signaling functionality. You might also want to read up on NSLock.

Naaff
Reading up on the doc's this appears to do exactly what I needed. Thanks!
Lounges
A: 

Ah, those are poor man's condition variables.

You could use the NSCondition class, but I think it's better
to go straight to the source. Start with pthread_cond_init.

You gonna love it.

Rhythmic Fistman
NSCondition is a higher-level wrapper around pthreads. If the NSCondition/NSLock interface does the job, there's no need to go low-level.
Naaff
Well I guess you _could_ do it the easy way.
Rhythmic Fistman