#include "TThread.h"
#include "TPosixMutex.h"
#include "PosixThreadInc.h"
ClassImp(TPosixMutex)
TPosixMutex::TPosixMutex()
{
#if (PthreadDraftVersion == 4)
int rc = ERRNO(pthread_mutex_init(&fMutex, pthread_mutexattr_default));
#else
int rc = ERRNO(pthread_mutex_init(&fMutex, 0));
#endif
if (rc != 0)
SysError("TMutex", "pthread_mutex_init error");
}
TPosixMutex::~TPosixMutex()
{
int rc = ERRNO(pthread_mutex_destroy(&fMutex));
if (rc != 0)
SysError("~TMutex", "pthread_mutex_destroy error");
}
Int_t TPosixMutex::Lock()
{
return ERRNO(pthread_mutex_lock(&fMutex));
}
Int_t TPosixMutex::TryLock()
{
return ERRNO(pthread_mutex_trylock(&fMutex));
}
Int_t TPosixMutex::UnLock(void)
{
return ERRNO(pthread_mutex_unlock(&fMutex));
}
Last change: Wed Jun 25 08:50:51 2008
Last generated: 2008-06-25 08:50
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.