global-functions: $ScriptLock: check for successful removal of ticket
The script is already locked, so there is no second script to remove a ticket at the same time. However a new script can add a new ticket and overwrite the removal... Thus check for successful removal anyway.
This commit is contained in:
parent
8e2c783068
commit
4269bc9548
|
@ -946,13 +946,17 @@
|
|||
|
||||
:global ScriptLockOrder;
|
||||
|
||||
:local New [ :toarray "" ];
|
||||
:foreach Ticket in=($ScriptLockOrder->$Script) do={
|
||||
:if ($Ticket != $Remove) do={
|
||||
:set New ($New, $Ticket);
|
||||
:while (true) do={
|
||||
:local New [ :toarray "" ];
|
||||
:foreach Ticket in=($ScriptLockOrder->$Script) do={
|
||||
:if ($Ticket != $Remove) do={
|
||||
:set New ($New, $Ticket);
|
||||
}
|
||||
}
|
||||
:set ($ScriptLockOrder->$Script) $New;
|
||||
:delay 12ms;
|
||||
:if (($ScriptLockOrder->$Script->0) != $Remove) do={ :return true; }
|
||||
}
|
||||
:set ($ScriptLockOrder->$Script) $New;
|
||||
}
|
||||
|
||||
:if ([ :len [ / system script find where name=$Script ] ] = 0) do={
|
||||
|
|
Loading…
Reference in New Issue