Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ MT-multithreading and servers » MT/Locking Questions
Re: MT/Locking Questions [message #15587 is a reply to message #15560] Tue, 29 April 2008 19:09 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
mr_ped wrote on Tue, 29 April 2008 04:03


As you can see, there's some StaticMutex class also. I'm looking at the source right now, but I have still no idea why ordinary Mutex would be not good enough even for static variable of class.

Sorry.



The idea begind StaticMutex is this: Normal Mutex has intialization code in constructor. That might cause problems if you are using it as global variable - some global initialization (e.g. INITBLOCK) might try to lock uninitialized mutex.

StaticMutex is a simple wrapper that has no constructor and constructs itself at first call to Enter (in fact, it constructs a regular Mutex inside Smile. However, it can only be used as static or global variable (because it employs initial zero initialization).

Mirek
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: How to send broadcast
Next Topic: PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP not defined
Goto Forum:
  


Current Time: Thu Mar 28 21:50:20 CET 2024

Total time taken to generate the page: 0.01402 seconds