From: SourceForge.net <no...@so...> - 2012-12-02 01:32:09
|
Bugs item #3591332, was opened at 2012-11-30 04:53 Message generated for change (Comment added) made by tjapoeh You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=396644&aid=3591332&group_id=29557 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None >Status: Closed Resolution: None Priority: 5 Private: No Submitted By: Frank Olthuis (tjapoeh) Assigned to: Nobody/Anonymous (nobody) Summary: Loki::Mutex has no effect on Windows Initial Comment: Loki's locking paradigm expect locking and unlocking to take place by way of the oneliner <code> typename MyThreadingModel::Lock lock; </code> 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: Mutex() LOKI_THREADS_MUTEX_CTOR(mtx_) { LOKI_THREADS_MUTEX_INIT(&mtx_); LOKI_THREADS_MUTEX_LOCK(&mtx_); } ~Mutex() { LOKI_THREADS_MUTEX_UNLOCK(&mtx_); LOKI_THREADS_MUTEX_DELETE(&mtx_); } ---------------------------------------------------------------------- >Comment By: Frank Olthuis (tjapoeh) Date: 2012-12-01 17:32 Message: Ah, dealing with race conditinos can make your mind fuzzy, apparently. Of course the locking is done by the Lock class of the threading policy. ---------------------------------------------------------------------- Comment By: Frank Olthuis (tjapoeh) Date: 2012-12-01 17:32 Message: This problem is not a bug within the Loki library. It is something that is wrong with the compiler or other libraries you are using. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=396644&aid=3591332&group_id=29557 |