tesseract  4.0.0-1-g2a2b
tesseract::CCUtilMutex Class Reference

#include <ccutil.h>

Public Member Functions

 CCUtilMutex ()
 
void Lock ()
 
void Unlock ()
 

Detailed Description

Definition at line 35 of file ccutil.h.

Constructor & Destructor Documentation

◆ CCUtilMutex()

tesseract::CCUtilMutex::CCUtilMutex ( )

Definition at line 35 of file ccutil.cpp.

35  {
36 #ifdef _WIN32
37  mutex_ = CreateMutex(0, FALSE, 0);
38 #else
39  pthread_mutex_init(&mutex_, nullptr);
40 #endif
41 }
#define FALSE
Definition: capi.h:52

Member Function Documentation

◆ Lock()

void tesseract::CCUtilMutex::Lock ( )

Definition at line 43 of file ccutil.cpp.

43  {
44 #ifdef _WIN32
45  WaitForSingleObject(mutex_, INFINITE);
46 #else
47  pthread_mutex_lock(&mutex_);
48 #endif
49 }

◆ Unlock()

void tesseract::CCUtilMutex::Unlock ( )

Definition at line 51 of file ccutil.cpp.

51  {
52 #ifdef _WIN32
53  ReleaseMutex(mutex_);
54 #else
55  pthread_mutex_unlock(&mutex_);
56 #endif
57 }

The documentation for this class was generated from the following files: