diff options
author | Wim Vriend <facetracknoir@gmail.com> | 2011-03-21 21:32:13 +0000 |
---|---|---|
committer | Wim Vriend <facetracknoir@gmail.com> | 2011-03-21 21:32:13 +0000 |
commit | 7eeb8dfaede7bb54b37b8ea538135914a43ab011 (patch) | |
tree | 890f04508697583a3d3e1b849181122278096701 /faceAPI/lock.h | |
parent | 09b4c95b8036b9466ca89acbe0b1f3d810499863 (diff) |
New effort to embrace faceAPI 3.2.6
git-svn-id: svn+ssh://svn.code.sf.net/p/facetracknoir/code@54 19e81ba0-9b1a-49c3-bd6c-561e1906d5fb
Diffstat (limited to 'faceAPI/lock.h')
-rw-r--r-- | faceAPI/lock.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/faceAPI/lock.h b/faceAPI/lock.h new file mode 100644 index 00000000..efe38605 --- /dev/null +++ b/faceAPI/lock.h @@ -0,0 +1,35 @@ +#ifndef SM_API_TESTAPPCONSOLE_LOCK_H
+#define SM_API_TESTAPPCONSOLE_LOCK_H
+
+#include "mutex.h"
+
+namespace sm
+{
+ namespace faceapi
+ {
+ namespace samplecode
+ {
+ // A very simple scoped-lock class for sample code purposes.
+ // It is recommended that you use the boost threads library.
+ class Lock
+ {
+ public:
+ Lock(const Mutex &mutex): _mutex(mutex)
+ {
+ _mutex.lock();
+ }
+ ~Lock()
+ {
+ _mutex.unlock();
+ }
+ private:
+ // Noncopyable
+ Lock(const Lock &);
+ Lock &operator=(const Lock &);
+ private:
+ const Mutex &_mutex;
+ };
+ }
+ }
+}
+#endif
|