overte-org / overte

Overte open source virtual worlds platform.
https://overte.org/
Other
128 stars 47 forks source link

Fixed deadlocks in Recording API #959

Closed ksuprynowicz closed 1 month ago

ksuprynowicz commented 1 month ago

This fixes deadlock in Interface and in Assignment Client due to Recording API calls. Earlier all Recording script API calls happened on main thread using BLOCKING_INVOKE_METHOD, which is fine for ones that don't do anything script engine-related, but will cause a deadlock when script value such as script callback is copied or accessed. I added a recursive mutex to all calls to be sure that it's thread-safe.

ksuprynowicz commented 1 month ago

I needed to restore some of the invoke calls - I didn't notice that some of them were calling Deck::processFrames() which needs to happen on main thread so Recording API stopped working after removing them.