mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-23 13:07:07 +01:00
Fix race condition with DMAPI custom event creation/completion
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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]")
|
||||
|
||||
Reference in New Issue
Block a user