Skip to content

Prevent multiple instances#25

Merged
handruin merged 1 commit intohandruin:masterfrom
ngreyling:multiple_instances
Mar 17, 2017
Merged

Prevent multiple instances#25
handruin merged 1 commit intohandruin:masterfrom
ngreyling:multiple_instances

Conversation

@ngreyling
Copy link
Contributor

Prevent multiple competing instances by having the application check whether it is the only instance when it is run.

@handruin
Copy link
Owner

Does this stop me from opening more than one instance of the spdif-ka utility because the Mutex is looking for another Mutex named "Globalspdif-ka_mutex"? From what I can tell a new Mutex is instantiated without ownership and a specified name and then a wait of zero milliseconds is specified.

@ngreyling
Copy link
Contributor Author

My understanding of the way this works is that a new mutex is created with the name "Global\spdif-ka_mutex". Any subsequent instance that is launched while the first instance is still running will try to immediately (waiting zero milliseconds) acquire a lock on a mutex using that same name. Because it is already in use, it will immediately fail to do so.

@handruin
Copy link
Owner

Thanks for adding this. I'll merge it in and start testing with it.

@handruin handruin merged commit 3cacae5 into handruin:master Mar 17, 2017
@ngreyling ngreyling deleted the multiple_instances branch April 20, 2017 01:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants