Ejemplo n.º 1
0
void LintelLog::maybeInitInstance() {
    static SimpleMutex init_mutex;

    // is this actually safe?  Really don't want to have to take the
    // lock when we almost never need to.
    if (instance == NULL) {
	init_mutex.lock();
	if (instance == NULL) {
	    instance_data *tmp = new instance_data();
	    tmp->mutex.lock(); // try to force the above to be 
	    tmp->mutex.unlock();
	    instance = tmp;
	}
	init_mutex.unlock();
    }
}
Ejemplo n.º 2
0
 RemapLock::RemapLock() {
     _remapLock.lock();
 }
Ejemplo n.º 3
0
SimpleThreadLock::SimpleThreadLock(SimpleMutex &mutex) : m_mutex(mutex), m_locked(true)
{
	mutex.lock();
}