Hi, looking at the class Thread it uses a static variable to point to the Main Thread.
I am just curious can multiple instances of Urho3D Engines exist in the same process? Using analogy in programming languages, Lua allows multiple interpreters to exist concurrently, while Python suffers from a “global lock” and cannot have more than one instance of its interpreter in a process. Looking at the Urho3D sources at a high level it seems there is no obvious restrictions that only one instance (of a Context or Engine) can exist.
(Use case: multiple OS level (X11) windows on GNU/Linux, each window rendering with its own Urho3D context/engine in its own thread, running concurrently, all in the same process)
If multiple instances can exist, then should the main thread be tracked at the basis of contexts; that is, the main thread pointer should exist inside the Context class and different threads can serve as the main threads of different contexts, one per context or engine and each independent of the other.
And the thread class needs to take a context as an explicit or implicit parameter for its main thread setting and checking functions.
I hope the above description is true:-)