View Full Version : Mutex equivalent in Cocoa

Feb 20, 2008, 06:40 AM
I am using mutex objects in C# to create single instance of the application. I will try to create a mutex object in main, if already created, it will return displaying message "Another instance is running".
I would like to know the euqivalent of mutex in Cocoa. I couldn't find the equivalent of mutex in documentation. Or any other way is there to create single instance of application in Mac programming.

Feb 20, 2008, 06:45 AM
The very first result on Google for "Cocoa Mutex" returns the Apple documentation on the very subject (http://developer.apple.com/documentation/Cocoa/Conceptual/Multithreading/ThreadSafety/chapter_5_section_7.html).

Seriously: next time actually try searching instead of lying to us and saying you have.

Feb 20, 2008, 08:46 AM
^^ You're wrong now, the first hit is now this thread :p.

Feb 20, 2008, 08:57 AM
Wow, the googlebot is fast, a little too fast...

Feb 20, 2008, 09:04 AM
Yikes! I guess that means that MacRumors (as a whole) has a higher PageRank score than developer.apple.com! We rule :D