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
2009-07-07 22:39:11
Reading up on the doc's this appears to do exactly what I needed. Thanks!
Lounges
2009-07-07 23:19:00
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
2009-07-07 23:18:47
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
2009-07-08 01:21:56