It is apparently possible for multiple threads to reach the same point in the code, both will see event == 'return' and key in call_pending and then both will attempt to remove the pending call.
Hopefully the background thread processing the queue isn't too confused by the duplicated events.
It is apparently possible for multiple threads to reach the same point in the code, both will see
event == 'return'
andkey in call_pending
and then both will attempt to remove the pending call.Hopefully the background thread processing the queue isn't too confused by the duplicated events.