winix/core/synchro.cpp

36 lines
385 B
C++
Executable File

/*
* This file is a part of Winix
* and is not publicly distributed
*
* Copyright (c) 2010, Tomasz Sowa
* All rights reserved.
*
*/
#include "synchro.h"
Synchro::Synchro() : mutex(PTHREAD_MUTEX_INITIALIZER)
{
was_stop_signal = false;
}
bool Synchro::Lock()
{
return pthread_mutex_lock(&mutex) == 0;
}
void Synchro::Unlock()
{
pthread_mutex_unlock(&mutex);
}