SLAMflex SE  0.1.0
SLAMflex provides detection and tracking of dominant planes for smartphone devices. This plane can then be used to show AR content relative to the plane orientation. The detection of plane is performed in the field of view of the smartphone camera. In subsequent frames it is tracked. The interface returns the plane position and orientation.
synchronized.cpp
Go to the documentation of this file.
1 #include "synchronized.h"
2 
3 namespace CVD {
4 pthread_mutexattr_t Synchronized::ourAttr;
5 bool Synchronized::ourInitFlag = false;
6 
8 {
9  if (!ourInitFlag)
10  {
11  pthread_mutexattr_init(&ourAttr);
12  pthread_mutexattr_settype(&ourAttr, PTHREAD_MUTEX_RECURSIVE);
13  ourInitFlag = true;
14  }
15  pthread_mutex_init(&myMutex, &ourAttr);
16 }
17 
19 {
20  lock();
21  pthread_mutex_destroy(&myMutex);
22 }
23 
24 void Synchronized::lock() const
25 {
26  pthread_mutex_lock(&myMutex);
27 }
28 
30 {
31  pthread_mutex_unlock(&myMutex);
32 }
33 
34 }
static bool ourInitFlag
Definition: synchronized.h:32
void lock() const
Acquire the lock; this blocks until the lock is available.
static pthread_mutexattr_t ourAttr
Definition: synchronized.h:31
Synchronized()
Create an initially unlocked mutex.
Definition: synchronized.cpp:7
pthread_mutex_t myMutex
Definition: synchronized.h:33
Definition: abs.h:24
void unlock() const
Release the lock.
virtual ~Synchronized()
The lock is acquired before deconstruction.