Platforms to show: All Mac Windows Linux Cross-Platform

Back to NamedMutexMBS class.

NamedMutexMBS.Constructor(Name as string)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Process MBS Util Plugin 20.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The constructor to create a new mutex.

Name should be a simple text, but unique, so we recommend reverse domain notation.
The name should not contain a slash.
If mutex exists already, we open it. The mutex lives until the last application closed it.

If name matches the name of an existing event, semaphore, waitable timer, job, or file-mapping object, the function fails.
Raises an UnsupportedOperationException on failure.

You can open the same mutex twice and get different Xojo objects from the plugin for both.

NamedMutexMBS.Lock

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Process MBS Util Plugin 20.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Locks the mutex.

Blocks until mutex is locked.
Please call Unlock later to unlock.

To avoid you looking up the app, we limit locking to one minute. After that you get a timeout error.

NamedMutexMBS.TryLock as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Process MBS Util Plugin 20.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Tries to lock the mutex.

Returns true if locked or false if the lock can't be set.
If false is returned another app may have a lock currently.
Please call Unlock later to unlock if you get back true.

NamedMutexMBS.Unlock

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Process MBS Util Plugin 20.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Unlocks the mutex.

The items on this page are in the following plugins: MBS Util Plugin.


The biggest plugin in space...