Fix deadlock in physics system (#6414)

  1. Reorder unlock and notify_all calls to avoid notifying when not all worker threads are waiting.
  2. Make sure main thread does not attempt to exclusively lock mSimulationMutex while not all workers are done with previous frame.
  3. Replace mNewFrame flag by counter to avoid modification from multiple threads.

See this comment for more details.

Fixes #6414 (closed).

Edited by elsid

Merge request reports

Loading