EndExclusiveControl

Top  Previous  Next

Prototype

 

EndExclusiveControl

 

Description

 

It is the result from the script in multitasking. If two scripts access contemporary at the same resource the system could crash. To avoid this you have to use the BeginExclusiveControl instruction. This instruction avoids that other thread can take the control until the EndExclusiveControl function is called. The first of this function return false if the other script have just the exclusive control.

 

Parameters

 

None

 

Returned Value

 

None

 

Notes

 

None.

 

Example

 

Ended:=False;

Repeat

 InExclusive:=BeginExclusiveControl;

 if InExclusive then

   begin

    ShowMessage('The exclusive control is obtained !');

    EndExclusiveControl;

    Ended:=True;

   end

 else

   begin

     ShowMessage('The exclusive control is not obtained ! Repeat...');

   end;

Until Ended=True;