diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2013-09-14 15:34:44 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2013-09-14 15:34:44 +0200 |
commit | c58c0af311892929dbce4e5437c4035214552438 (patch) | |
tree | 2a6d78d740b2a83f7fe5822068bbb006a3e8a8a9 /faceapi/mutex.h | |
parent | e695bca32e6f34461dfa720a2b693835adbb9422 (diff) |
Run dos2unix on the tree. No user-facing changes.
Diffstat (limited to 'faceapi/mutex.h')
-rw-r--r-- | faceapi/mutex.h | 92 |
1 files changed, 46 insertions, 46 deletions
diff --git a/faceapi/mutex.h b/faceapi/mutex.h index a4f84705..b1a013e8 100644 --- a/faceapi/mutex.h +++ b/faceapi/mutex.h @@ -1,46 +1,46 @@ -#ifndef SM_API_TESTAPPCONSOLE_MUTEX_H
-#define SM_API_TESTAPPCONSOLE_MUTEX_H
-
-#include <exception>
-
-namespace sm
-{
- namespace faceapi
- {
- namespace samplecode
- {
- // A very simple mutex class for sample code purposes.
- // It is recommended that you use the boost threads library.
- class Mutex
- {
- public:
- Mutex()
- {
- if (!InitializeCriticalSectionAndSpinCount(&_cs,0x80000400))
- {
- throw std::exception();
- }
- }
- ~Mutex()
- {
- DeleteCriticalSection(&_cs);
- }
- void lock() const
- {
- EnterCriticalSection(&_cs);
- }
- void unlock() const
- {
- LeaveCriticalSection(&_cs);
- }
- private:
- // Noncopyable
- Mutex(const Mutex &);
- Mutex &operator=(const Mutex &);
- private:
- mutable CRITICAL_SECTION _cs;
- };
- }
- }
-}
-#endif
+#ifndef SM_API_TESTAPPCONSOLE_MUTEX_H +#define SM_API_TESTAPPCONSOLE_MUTEX_H + +#include <exception> + +namespace sm +{ + namespace faceapi + { + namespace samplecode + { + // A very simple mutex class for sample code purposes. + // It is recommended that you use the boost threads library. + class Mutex + { + public: + Mutex() + { + if (!InitializeCriticalSectionAndSpinCount(&_cs,0x80000400)) + { + throw std::exception(); + } + } + ~Mutex() + { + DeleteCriticalSection(&_cs); + } + void lock() const + { + EnterCriticalSection(&_cs); + } + void unlock() const + { + LeaveCriticalSection(&_cs); + } + private: + // Noncopyable + Mutex(const Mutex &); + Mutex &operator=(const Mutex &); + private: + mutable CRITICAL_SECTION _cs; + }; + } + } +} +#endif |