Loki's locking paradigm expect locking and unlocking to take place by way of the oneliner
typename MyThreadingModel::Lock lock;
This requires locking to take place in the mutex's contructor, and unlocking in its destructor. On Windows though, Loki's default Mutex class makes use of a CRITICAL_SECTION, which is only created and destroyed in the contructor and destructor respectively. Neither EnterCriticalSection nor LeaveCriticalSection are called.
In my view, the constructor and destructor should be as follows:
Log in to post a comment.