Descriptor queue safety fix

Fixed a bug whereby if one were to get new Descriptor classes across
several threads then the Mutex for the descriptor queue would be reinitialzied
upon static initialization of the thread as the static initialization block
was not set to __gshared, causing a global re-write of a re-initted Mutex,
never the same Mutex
This commit is contained in:
Tristan B. Velloza Kildaire 2022-05-24 19:23:46 +02:00
parent 8ede79bf49
commit 2251a00284
1 changed files with 1 additions and 4 deletions

View File

@ -110,11 +110,8 @@ public abstract class Descriptor : Signal
/**
* Static initialization of the descriptor
* class ID queue's lock
*
* FIXME: BIG BUG FOR MULTITHREADED THIS MUST BE SET TO GSHARED TOO, else each thread
* will be overwriting the global descQueuLock
*/
static this()
__gshared static this()
{
descQueueLock = new Mutex();
}