From 0f17c894df83000273590743a991817735163fad Mon Sep 17 00:00:00 2001
From: Anders Blomdell <anders.blomdell@control.lth.se>
Date: Mon, 27 May 2013 17:08:53 +0200
Subject: [PATCH] Added pthtread_mutex_lock strawman.

---
 .bzrignore                         |  1 +
 lib/c/labcomm_private.h            |  2 +-
 lib/c/labcomm_pthread_mutex_lock.c | 17 +++++++++++++++++
 lib/c/labcomm_pthread_mutex_lock.h |  8 ++++++++
 4 files changed, 27 insertions(+), 1 deletion(-)
 create mode 100644 lib/c/labcomm_pthread_mutex_lock.c
 create mode 100644 lib/c/labcomm_pthread_mutex_lock.h

diff --git a/.bzrignore b/.bzrignore
index 2653f98..a340f79 100644
--- a/.bzrignore
+++ b/.bzrignore
@@ -32,3 +32,4 @@ examples/simple/example_encoder
 lib/c/test/test_labcomm_basic_type_encoding
 lib/c/test/test_labcomm_generated_encoding
 lib/java/se/lth/control/labcomm/WriterWrapper.class
+lib/c/liblabcomm.so.1
diff --git a/lib/c/labcomm_private.h b/lib/c/labcomm_private.h
index 60c0ce2..a06c7f1 100644
--- a/lib/c/labcomm_private.h
+++ b/lib/c/labcomm_private.h
@@ -42,7 +42,7 @@
  *
  */
 #define LABCOMM_DECLARE_SIGNATURE(name) \
-  struct labcomm_signature name __attribute__((section("labcomm")))
+  struct labcomm_signature __attribute__((section("labcomm"))) name 
 
 /*
  * Semi private lock declarations
diff --git a/lib/c/labcomm_pthread_mutex_lock.c b/lib/c/labcomm_pthread_mutex_lock.c
new file mode 100644
index 0000000..f8c58ef
--- /dev/null
+++ b/lib/c/labcomm_pthread_mutex_lock.c
@@ -0,0 +1,17 @@
+#include "labcomm.h"
+#include "labcomm_private.h"
+
+struct labcomm_lock *labcomm_pthread_mutex_lock_new()
+{
+  struct labcomm_lock *result;
+
+  result = malloc(sizeof(*result));
+  if (result == NULL) {
+    goto out;
+  }
+  
+out:
+  return result;
+
+}
+
diff --git a/lib/c/labcomm_pthread_mutex_lock.h b/lib/c/labcomm_pthread_mutex_lock.h
new file mode 100644
index 0000000..d4ff9f7
--- /dev/null
+++ b/lib/c/labcomm_pthread_mutex_lock.h
@@ -0,0 +1,8 @@
+#ifndef _LABCOMM_PTHREAD_MUTEX_LOCK_H_
+#define _LABCOMM_PTHREAD_MUTEX_LOCK_H_
+
+#include "labcomm.h"
+
+struct labcomm_lock *labcomm_pthread_mutex_lock_new();
+
+#endif
-- 
GitLab