ID : 5158
CreateMutex
Function
To request the creation of Mutex object and acquire the ID of Mutex object.
Syntax
CreateMutex(name)
Guaranteed entry
- Name
- Designate a name of Mutex object to be created by string type data.
Return value
Return the created Mutex object ID by integer type data.
Description
Request the creation of Mutex object and acquire the ID of Mutex object.
If there is no Mutex object with the designated name, create a new Mutex object and return it's ID. Task reference will be registered to the created object.
If there is already Mutex object with the same name, return the ID of Mutex object and add the own task reference to the object.
Related Terms
Mutex Object, CreateMutex, DeleteMutex, TakeMutex, GiveMutex, ResetMutex, MutexID, MutexState, Program Example 1 for Exclusion Control, Program Example 2 for Exclusion Control, Program Example 3 for Exclusion Control
Attention
Example
Sub Main
Dim n As Integer
n = CreateMutex(S[10])
TakeMutex n
' Statements
GiveMutex n
DeleteMutex n
End Sub
ID : 5158