Enhancement
Major
Detail
Major
Detail
If several interactions (threads) use the same TLContext it can come to a problem if an interaction makes an update on the session. Then different threads get to see different data states.
Solution
On the subsession a "lock" mechanism is introduced. Before a new thread is started with the TLContext of the main thread, the TLContext is locked, and as soon as the action in the context is finished, the lock is released again. This can be used to ensure that the thread performing the session update will refrain from doing so if the TLContext is locked.
Code migration
Calls of new threads must be checked if the TLContext of the forking thread is used here. If so, a tl:InContextThread should be used here. If this is not possible TLContext#lock() must be called before starting the thread, and as soon as the TLContext is no longer used TLContext#unlock().
Test
No test.