예제 #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();
    }
}
예제 #2
0
파일: mmap_win.cpp 프로젝트: MStumpp/mongo
 RemapLock::~RemapLock() {
     _remapLock.unlock();
 }