Fix race condition with DMAPI custom event creation/completion

This commit is contained in:
Jordan Dominion
2024-02-20 18:25:30 -05:00
parent 054c72cc1d
commit a43216210f
2 changed files with 3 additions and 4 deletions
+2 -3
View File
@@ -276,13 +276,12 @@
return TRUE
TGS_DEBUG_LOG("Waiting for completion of event ID: [event_id]")
pending_events[event_id] = TRUE
do
while(!pending_events[event_id])
sleep(world.tick_lag)
while(pending_events[event_id])
TGS_DEBUG_LOG("Completed wait on event ID: [event_id]")
pending_events -= event_id
return TRUE
+1 -1
View File
@@ -285,7 +285,7 @@
return TopicResponse("Invalid or missing [DMAPI5_EVENT_ID]")
TGS_DEBUG_LOG("Completing event ID [event_id]...")
pending_events -= event_id
pending_events[event_id] = TRUE
return TopicResponse()
return TopicResponse("Unknown command: [command]")