celix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ejans...@apache.org
Subject [2/6] celix git commit: added celixThreadMutex_tryLock as non block alternative to celixThreadMutex_lock
Date Fri, 19 Aug 2016 13:18:44 GMT
added celixThreadMutex_tryLock as non block alternative to celixThreadMutex_lock


Project: http://git-wip-us.apache.org/repos/asf/celix/repo
Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/f358e33a
Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/f358e33a
Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/f358e33a

Branch: refs/heads/feature/event_admin
Commit: f358e33a714a820e1d07c9b809d48dfef691062d
Parents: 840f34b
Author: Erik Jansman <ejansman@apache.org>
Authored: Wed Aug 17 15:35:03 2016 +0200
Committer: Erik Jansman <ejansman@apache.org>
Committed: Wed Aug 17 15:35:59 2016 +0200

----------------------------------------------------------------------
 utils/private/src/celix_threads.c    | 4 ++++
 utils/public/include/celix_threads.h | 1 +
 2 files changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/f358e33a/utils/private/src/celix_threads.c
----------------------------------------------------------------------
diff --git a/utils/private/src/celix_threads.c b/utils/private/src/celix_threads.c
index 64bdf5b..d5b9437 100644
--- a/utils/private/src/celix_threads.c
+++ b/utils/private/src/celix_threads.c
@@ -97,6 +97,10 @@ celix_status_t celixThreadMutex_lock(celix_thread_mutex_t *mutex) {
     return pthread_mutex_lock(mutex);
 }
 
+celix_status_t celixThreadMutex_tryLock(celix_thread_mutex_t *mutex) {
+	return  pthread_mutex_trylock(mutex);
+}
+
 celix_status_t celixThreadMutex_unlock(celix_thread_mutex_t *mutex) {
     return pthread_mutex_unlock(mutex);
 }

http://git-wip-us.apache.org/repos/asf/celix/blob/f358e33a/utils/public/include/celix_threads.h
----------------------------------------------------------------------
diff --git a/utils/public/include/celix_threads.h b/utils/public/include/celix_threads.h
index 8fc043e..c110154 100644
--- a/utils/public/include/celix_threads.h
+++ b/utils/public/include/celix_threads.h
@@ -73,6 +73,7 @@ enum {
 celix_status_t celixThreadMutex_create(celix_thread_mutex_t *mutex, celix_thread_mutexattr_t
*attr);
 celix_status_t celixThreadMutex_destroy(celix_thread_mutex_t *mutex);
 celix_status_t celixThreadMutex_lock(celix_thread_mutex_t *mutex);
+celix_status_t celixThreadMutex_tryLock(celix_thread_mutex_t *mutex);
 celix_status_t celixThreadMutex_unlock(celix_thread_mutex_t *mutex);
 
 celix_status_t celixThreadMutexAttr_create(celix_thread_mutexattr_t *attr);


Mime
View raw message