enhancement
major
minor
major
minor
If multiple interactions (threads) use the same TLContext, a problem can arise when one interaction updates the session. As a result, different threads will see different data states.
Solution
A "lock" mechanism is implemented at the subsession level. Before a new thread is started using the main thread’s TLContext, the TLContext is locked; as soon as the action within that context is complete, the lock is released. This ensures that the thread performing the session update will not do so if the TLContext is locked.
Code Migration
Calls to new threads must be checked to ensure that the TLContext of the forking thread is not being used here. If so, a `tl:InContextThread` should be used here. If this is not possible, `TLContext#lock() ` must be called before the thread starts, and `TLContext#unlock()` must be called as soon as the TLContext is no longer in use.
Test
No test.