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.h
Go to the documentation of this file.
1 #ifndef LIBSLAMFLEX_JNI_SYNCHRONIZED_H_
2 #define LIBSLAMFLEX_JNI_SYNCHRONIZED_H_
3 
4 // POSIX threads
5 #include "pthread.h"
6 
7 namespace CVD {
8 
15 {
16  public:
18  Synchronized();
20  virtual ~Synchronized();
22 
25  void lock() const;
26 
28  void unlock() const;
29 
30  protected:
31  static pthread_mutexattr_t ourAttr;
32  static bool ourInitFlag;
33  mutable pthread_mutex_t myMutex;
34 };
35 
40 struct Lock {
42  Lock(const Synchronized& obj) : myObject(obj) { myObject.lock(); }
43  virtual ~Lock() { myObject.unlock(); }
44 };
45 
46 }
47 #endif
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.
virtual ~Lock()
Definition: synchronized.h:43
Lock(const Synchronized &obj)
Definition: synchronized.h:42
const Synchronized & myObject
Definition: synchronized.h:41