Function EN Version 4.60

@ReleaseMutexSemaphore

Misc System Text

Syntax

@ReleaseMutexSemaphore(MUTEXSEMAPHOREHANDLE);

Description

Releases the mutex semaphore with the mutex semaphore handle (MSH) MUTEXSEMAPHOREHANDLE .
On success, @True is returned; otherwise @ERROR.

A mutex semaphore can be owned (requested) by only one task at a time.
(This is used to allow certain parts of a script to be executed exclusively by only one task at a time.)

For example, access to a GLOBAL counter variable that is to be continuously incremented by multiple tasks.

Example: @ReleaseMutexSemaphore(MUTEXSEMAPHOREHANDLE);

TEXTSEMAPHORENAME:="TEST_SEMAPHORE_NAME";

MSH:=@CreateMutexSemaphore(TEXTSEMAPHORENAME);
@RequestMutexSemaphore(MSH);

@ReleaseMutexSemaphore(MSH);
MSH:=@CloseMutexSemaphore(MSH);

A mutex semaphore named "TEST_SEMAPHORE_NAME" is created, requested, released, and closed again.

Note : This text was machine-translated and may contain inaccuracies.