aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2021-07-25 23:08:23 +0200
committerGravatar Christian Hesse <mail@eworm.de>2021-07-25 23:19:54 +0200
commit4269bc9548ecbbd8d0b1fd8dfcfa590175dd3a30 (patch)
tree2058cd97e7006ad621e8181fc29fc1c6cfdab24f
parent8e2c783068829c523c3b8fa8835f77f3a6ef56e0 (diff)
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.
-rw-r--r--global-functions14
1 files changed, 9 insertions, 5 deletions
diff --git a/global-functions b/global-functions
index 7a0bb39..bbea143 100644
--- a/global-functions
+++ b/global-functions
@@ -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={