BUG: Fix race condition
BUG: Fix race condition

There is a very rare race condition where a second event might be triggered in a second thread at almost the same time as the first event, causing the wrong actions to get called.
bburan/psiexperiment