Topics   All   MacOS (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Guides   Examples
New in version: 9.0   9.1   9.2   9.3   9.4   9.5   10.0   10.1   10.2   10.3    Statistic  

Mutex.TryLock

Tries to lock the mutex.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
Mutex 10.2 Yes Yes Yes Yes Yes
MBS( "Mutex.TryLock"; Mutex )   More

Parameters

Parameter Description Example value
Mutex The reference number of the mutex. $mutex

Result

Returns 1, 0 or error.

Description

Tries to lock the mutex.
If the mutex is locked, this function returns 0, otherwise it returns 1 or an error.
Please call Mutex.Unlock later to unlock the mutex.

Examples

Try lock and unlock:

# lock it
Set Variable [ $r ; Value: MBS( "Mutex.TryLock"; $Mutex ) ]
If [ $r = 1 ]
    # do something
    #
    # finally unlock
    Set Variable [ $r ; Value: MBS( "Mutex.Unlock"; $Mutex ) ]
End If

See also

Blog Entries

Created 5th April 2020, last changed 5th April 2020


Mutex.Name   -   Mutex.Unlock

Feedback: Report problem or ask question.




Links
MBS FileMaker Plugins