|
-
August 12th, 2009, 10:32 AM
#1
Is CreateMutex() a atomic function?
I want to use CreateMutex() to prevent creating multiple instance of my application. But I'm not sure if two CreateMutex() could be called at the same time. If it can be happened then it can not perfectly prevent multiple instances to be created.
thanks.
-
August 12th, 2009, 11:01 AM
#2
Re: Is CreateMutex() a atomic function?
Yes - you can consider CreateMutex as being "atomic" with respect to other threads also calling CreateMutex with the same name.
gg
-
August 13th, 2009, 07:48 PM
#3
Re: Is CreateMutex() a atomic function?
Yes, any named object is unique (throughout the same desktop, I believe) as long as it's not closed.
-
August 14th, 2009, 01:44 AM
#4
Re: Is CreateMutex() a atomic function?
 Originally Posted by coldstar
But I'm not sure if two CreateMutex() could be called at the same time.
Of course they could. And someone will definitely win the race.
Best regards,
Igor
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|