summaryrefslogtreecommitdiff
path: root/src/Threads.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/Threads.cc')
-rw-r--r--src/Threads.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/Threads.cc b/src/Threads.cc
new file mode 100644
index 0000000..7c928f8
--- /dev/null
+++ b/src/Threads.cc
@@ -0,0 +1,13 @@
+#include <Exceptions.h>
+#include <Threads.h>
+
+Balau::Lock::Lock() {
+ int r;
+ pthread_mutexattr_t attr;
+ r = pthread_mutexattr_init(&attr);
+ Assert(r == 0);
+ r = pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
+ Assert(r == 0);
+ r = pthread_mutex_init(&m_lock, &attr);
+ Assert(r == 0);
+}