multithreading - Mutex among threads of same process -


i using mutex prevent same process being executed twice, in way:

createmutex( null, true, "mutexname" ); if ( getlasterror() == error_already_exists ) { return 1;} 

so if mutex exists in system, process exits.

now wandering, possible similar thing among threads of same process? give thread mutex, , exit if thread same mutex exists in process.


Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -