-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
67 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/** | ||
* ocv_ar - OpenCV based Augmented Reality library | ||
* | ||
* Helper function class for threading -- implementation file. | ||
* | ||
* Author: Markus Konrad <konrad@htw-berlin.de>, July 2014. | ||
* INKA Research Group, HTW Berlin - http://inka.htw-berlin.de/ | ||
* | ||
* See LICENSE for license. | ||
*/ | ||
|
||
#include "threading.h" | ||
|
||
using namespace ocv_ar; | ||
|
||
pthread_mutex_t Threading::mutex; | ||
|
||
void Threading::init() { | ||
pthread_mutex_init (&mutex, NULL); | ||
} | ||
|
||
void Threading::mutexLock() { | ||
pthread_mutex_lock(&mutex); | ||
} | ||
|
||
void Threading::mutexUnlock() { | ||
pthread_mutex_unlock(&mutex); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/** | ||
* ocv_ar - OpenCV based Augmented Reality library | ||
* | ||
* Helper function class for threading -- header file. | ||
* | ||
* Author: Markus Konrad <konrad@htw-berlin.de>, July 2014. | ||
* INKA Research Group, HTW Berlin - http://inka.htw-berlin.de/ | ||
* | ||
* See LICENSE for license. | ||
*/ | ||
|
||
#ifndef OCV_AR_THREADING_H | ||
#define OCV_AR_THREADING_H | ||
|
||
#include <pthread.h> | ||
|
||
namespace ocv_ar { | ||
|
||
class Threading { | ||
public: | ||
static void init(); | ||
|
||
static void mutexLock(); | ||
static void mutexUnlock(); | ||
|
||
private: | ||
static pthread_mutex_t mutex; | ||
}; | ||
|
||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters