Author: abroekhuis
Date: Wed Jun  4 13:11:44 2014
New Revision: 1600183

URL: http://svn.apache.org/r1600183
Log:
CELIX-119: Updated framework to use pthreads (via a wrapper).

Modified:
    incubator/celix/trunk/framework/private/include/bundle_private.h
    incubator/celix/trunk/framework/private/include/framework_private.h
    incubator/celix/trunk/framework/private/src/bundle.c
    incubator/celix/trunk/framework/private/src/framework.c
    incubator/celix/trunk/framework/private/src/utils.c
    incubator/celix/trunk/framework/public/include/bundle.h
    incubator/celix/trunk/utils/private/src/celix_threads.c
    incubator/celix/trunk/utils/public/include/celix_threads.h

Modified: incubator/celix/trunk/framework/private/include/bundle_private.h
URL: 
http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/include/bundle_private.h?rev=1600183&r1=1600182&r2=1600183&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/include/bundle_private.h (original)
+++ incubator/celix/trunk/framework/private/include/bundle_private.h Wed Jun  4 
13:11:44 2014
@@ -39,9 +39,9 @@ struct bundle {
        manifest_pt manifest;
        apr_pool_t *memoryPool;
 
-       apr_thread_mutex_t *lock;
+       celix_thread_mutex_t lock;
        int lockCount;
-       apr_os_thread_t lockThread;
+       celix_thread_t lockThread;
 
        struct framework * framework;
 };

Modified: incubator/celix/trunk/framework/private/include/framework_private.h
URL: 
http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/include/framework_private.h?rev=1600183&r1=1600182&r2=1600183&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/include/framework_private.h 
(original)
+++ incubator/celix/trunk/framework/private/include/framework_private.h Wed Jun 
 4 13:11:44 2014
@@ -59,12 +59,12 @@ struct framework {
     struct serviceRegistry * registry;
     bundle_cache_pt cache;
 
-    celix_thread_cond_t *shutdownGate;
-    celix_thread_cond_t *condition;
+    celix_thread_cond_t shutdownGate;
+    celix_thread_cond_t condition;
 
-    celix_thread_mutex_t *installRequestLock;
-    celix_thread_mutex_t *mutex;
-    celix_thread_mutex_t *bundleLock;
+    celix_thread_mutex_t installRequestLock;
+    celix_thread_mutex_t mutex;
+    celix_thread_mutex_t bundleLock;
 
     celix_thread_t globalLockThread;
     array_list_pt globalLockWaitersList;

Modified: incubator/celix/trunk/framework/private/src/bundle.c
URL: 
http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/src/bundle.c?rev=1600183&r1=1600182&r2=1600183&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/src/bundle.c (original)
+++ incubator/celix/trunk/framework/private/src/bundle.c Wed Jun  4 13:11:44 
2014
@@ -26,8 +26,6 @@
 #include <stdlib.h>
 #include <string.h>
 #include <apr_strings.h>
-#include <apr_portable.h>
-#include <apr_thread_proc.h>
 
 #include "framework_private.h"
 #include "bundle_private.h"
@@ -70,7 +68,7 @@ celix_status_t bundle_create(bundle_pt *
         bundle_addModule(*bundle, module);
         // (*bundle)->module = module;
 
-        apr_status = apr_thread_mutex_create(&(*bundle)->lock, 
APR_THREAD_MUTEX_UNNESTED, (*bundle)->memoryPool);
+        apr_status = celixThreadMutex_create(&(*bundle)->lock, NULL);
         if (apr_status != APR_SUCCESS) {
                status = CELIX_ILLEGAL_STATE;
         } else {
@@ -110,7 +108,7 @@ celix_status_t bundle_createFromArchive(
         apr_status_t apr_status;
 
                bundle_addModule(*bundle, module);
-        apr_status = apr_thread_mutex_create(&(*bundle)->lock, 
APR_THREAD_MUTEX_UNNESTED, (*bundle)->memoryPool);
+        apr_status = celixThreadMutex_create(&(*bundle)->lock, NULL);
         if (apr_status != APR_SUCCESS) {
                        status = CELIX_ILLEGAL_STATE;
                } else {
@@ -136,7 +134,7 @@ celix_status_t bundle_destroy(bundle_pt 
        }
        arrayListIterator_destroy(iter);
        arrayList_destroy(bundle->modules);
-       apr_thread_mutex_destroy(bundle->lock);
+       celixThreadMutex_destroy(&bundle->lock);
 
        apr_pool_destroy(bundle->memoryPool);
        return CELIX_SUCCESS;
@@ -482,7 +480,7 @@ celix_status_t bundle_isLockable(bundle_
        celix_status_t status = CELIX_SUCCESS;
        apr_status_t apr_status;
 
-       apr_status = apr_thread_mutex_lock(bundle->lock);
+       apr_status = celixThreadMutex_lock(&bundle->lock);
        if (apr_status != APR_SUCCESS) {
                status = CELIX_BUNDLE_EXCEPTION;
        } else {
@@ -492,7 +490,7 @@ celix_status_t bundle_isLockable(bundle_
                        *lockable = (bundle->lockCount == 0) || (equals);
                }
 
-               apr_status = apr_thread_mutex_unlock(bundle->lock);
+               apr_status = celixThreadMutex_unlock(&bundle->lock);
                if (apr_status != APR_SUCCESS) {
                        status = CELIX_BUNDLE_EXCEPTION;
                }
@@ -503,17 +501,17 @@ celix_status_t bundle_isLockable(bundle_
        return status;
 }
 
-celix_status_t bundle_getLockingThread(bundle_pt bundle, apr_os_thread_t 
*thread) {
+celix_status_t bundle_getLockingThread(bundle_pt bundle, celix_thread_t 
*thread) {
        celix_status_t status = CELIX_SUCCESS;
        apr_status_t apr_status;
 
-       apr_status = apr_thread_mutex_lock(bundle->lock);
+       apr_status = celixThreadMutex_lock(&bundle->lock);
        if (apr_status != APR_SUCCESS) {
                status = CELIX_BUNDLE_EXCEPTION;
        } else {
                *thread = bundle->lockThread;
 
-               apr_status = apr_thread_mutex_unlock(bundle->lock);
+               apr_status = celixThreadMutex_unlock(&bundle->lock);
                if (apr_status != APR_SUCCESS) {
                        status = CELIX_BUNDLE_EXCEPTION;
                }
@@ -528,7 +526,7 @@ celix_status_t bundle_lock(bundle_pt bun
        celix_status_t status = CELIX_SUCCESS;
        bool equals;
 
-       apr_thread_mutex_lock(bundle->lock);
+       celixThreadMutex_lock(&bundle->lock);
 
        status = thread_equalsSelf(bundle->lockThread, &equals);
        if (status == CELIX_SUCCESS) {
@@ -536,12 +534,12 @@ celix_status_t bundle_lock(bundle_pt bun
                        *locked = false;
                } else {
                        bundle->lockCount++;
-                       bundle->lockThread = apr_os_thread_current();
+                       bundle->lockThread = celixThread_self();
                        *locked = true;
                }
        }
 
-       apr_thread_mutex_unlock(bundle->lock);
+       celixThreadMutex_unlock(&bundle->lock);
 
        framework_logIfError(bundle->framework->logger, status, NULL, "Failed 
to lock bundle");
 
@@ -553,7 +551,7 @@ celix_status_t bundle_unlock(bundle_pt b
 
        bool equals;
 
-       apr_thread_mutex_lock(bundle->lock);
+       celixThreadMutex_lock(&bundle->lock);
 
        if (bundle->lockCount == 0) {
                *unlocked = false;
@@ -571,7 +569,7 @@ celix_status_t bundle_unlock(bundle_pt b
                }
        }
 
-       apr_thread_mutex_unlock(bundle->lock);
+       celixThreadMutex_unlock(&bundle->lock);
 
        framework_logIfError(bundle->framework->logger, status, NULL, "Failed 
to unlock bundle");
 

Modified: incubator/celix/trunk/framework/private/src/framework.c
URL: 
http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/src/framework.c?rev=1600183&r1=1600182&r2=1600183&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/src/framework.c (original)
+++ incubator/celix/trunk/framework/private/src/framework.c Wed Jun  4 13:11:44 
2014
@@ -33,8 +33,6 @@
 #include <apr_file_io.h>
 #include <apr_general.h>
 #include <apr_strings.h>
-#include <apr_thread_mutex.h>
-#include <apr_thread_proc.h>
 #include <apr_uuid.h>
 #ifdef _WIN32
 #include <winbase.h>
@@ -202,7 +200,6 @@ celix_status_t framework_create(framewor
             (*framework)->bundleListeners = NULL;
             (*framework)->frameworkListeners = NULL;
             (*framework)->requests = NULL;
-            (*framework)->shutdownGate = NULL;
             (*framework)->configurationMap = config;
             (*framework)->logger = logger;
 
@@ -1811,7 +1808,6 @@ celix_status_t framework_acquireBundleLo
                bool isSelf = false;
 
                bundle_isLockable(bundle, &lockable);
-               // #TODO
                thread_equalsSelf(framework->globalLockThread, &isSelf);
 
                while (!lockable
@@ -1828,11 +1824,11 @@ celix_status_t framework_acquireBundleLo
                                        && (lockingThread != 0)
                                        && 
arrayList_contains(framework->globalLockWaitersList, &lockingThread)) {
                                framework->interrupted = true;
-                               
celixThreadCondition_signal_thread_np(&framework->condition, 
bundle_getLockingThread(bundle));
-//                             
celixThreadCondition_signal(framework->condition);
+//                             
celixThreadCondition_signal_thread_np(&framework->condition, 
bundle_getLockingThread(bundle));
+                               
celixThreadCondition_signal(&framework->condition);
                        }
 
-            celixThreadCondition_wait(framework->condition, 
framework->bundleLock);
+            celixThreadCondition_wait(&framework->condition, 
&framework->bundleLock);
 
                        status = bundle_isLockable(bundle, &lockable);
                        if (status != CELIX_SUCCESS) {
@@ -1853,7 +1849,7 @@ celix_status_t framework_acquireBundleLo
                                }
                        }
                }
-               celixThreadMutex_unlock(framework->bundleLock);
+               celixThreadMutex_unlock(&framework->bundleLock);
        }
 
        framework_logIfError(framework->logger, status, NULL, "Failed to get 
bundle lock");
@@ -1865,19 +1861,19 @@ bool framework_releaseBundleLock(framewo
     bool unlocked;
     apr_os_thread_t lockingThread = 0;
 
-    celixThreadMutex_lock(framework->bundleLock);
+    celixThreadMutex_lock(&framework->bundleLock);
 
     bundle_unlock(bundle, &unlocked);
        if (!unlocked) {
-           celixThreadMutex_unlock(framework->bundleLock);
+           celixThreadMutex_unlock(&framework->bundleLock);
                return false;
        }
        bundle_getLockingThread(bundle, &lockingThread);
        if (lockingThread == 0) {
-           celixThreadCondition_broadcast(framework->condition);
+           celixThreadCondition_broadcast(&framework->condition);
        }
 
-       celixThreadMutex_unlock(framework->bundleLock);
+       celixThreadMutex_unlock(&framework->bundleLock);
 
        return true;
 }
@@ -1886,7 +1882,7 @@ bool framework_acquireGlobalLock(framewo
     bool interrupted = false;
        bool isSelf = false;
 
-       celixThreadMutex_lock(framework->bundleLock);
+       celixThreadMutex_lock(&framework->bundleLock);
 
        thread_equalsSelf(framework->globalLockThread, &isSelf);
 
@@ -1895,9 +1891,9 @@ bool framework_acquireGlobalLock(framewo
                        && (!isSelf)) {
                celix_thread_t currentThread = celixThread_self();
                arrayList_add(framework->globalLockWaitersList, &currentThread);
-               celixThreadCondition_broadcast(framework->condition);
+               celixThreadCondition_broadcast(&framework->condition);
 
-               celixThreadCondition_wait(framework->condition, 
framework->bundleLock);
+               celixThreadCondition_wait(&framework->condition, 
&framework->bundleLock);
                if (framework->interrupted) {
                        interrupted = true;
                        framework->interrupted = false;
@@ -1911,23 +1907,23 @@ bool framework_acquireGlobalLock(framewo
                framework->globalLockThread = celixThread_self();
        }
 
-       celixThreadMutex_unlock(framework->bundleLock);
+       celixThreadMutex_unlock(&framework->bundleLock);
 
        return !interrupted;
 }
 
 celix_status_t framework_releaseGlobalLock(framework_pt framework) {
        int status = CELIX_SUCCESS;
-       if (celixThreadMutex_lock(framework->bundleLock) != 0) {
+       if (celixThreadMutex_lock(&framework->bundleLock) != 0) {
                fw_log(framework->logger, OSGI_FRAMEWORK_LOG_ERROR,  "Error 
locking framework bundle lock");
                return CELIX_FRAMEWORK_EXCEPTION;
        }
 
-       if (framework->globalLockThread == apr_os_thread_current()) {
+       if (framework->globalLockThread == celixThread_self()) {
                framework->globalLockCount--;
                if (framework->globalLockCount == 0) {
                        framework->globalLockThread = 0;
-                       if 
(celixThreadCondition_broadcast(framework->condition) != 0) {
+                       if 
(celixThreadCondition_broadcast(&framework->condition) != 0) {
                                fw_log(framework->logger, 
OSGI_FRAMEWORK_LOG_ERROR,  "Failed to broadcast global lock release.");
                                status = CELIX_FRAMEWORK_EXCEPTION;
                                // still need to unlock before returning
@@ -1937,7 +1933,7 @@ celix_status_t framework_releaseGlobalLo
                printf("The current thread does not own the global lock");
        }
 
-       if (celixThreadMutex_unlock(framework->bundleLock) != 0) {
+       if (celixThreadMutex_unlock(&framework->bundleLock) != 0) {
                fw_log(framework->logger, OSGI_FRAMEWORK_LOG_ERROR,  "Error 
unlocking framework bundle lock");
                return CELIX_FRAMEWORK_EXCEPTION;
        }
@@ -1948,18 +1944,18 @@ celix_status_t framework_releaseGlobalLo
 }
 
 celix_status_t framework_waitForStop(framework_pt framework) {
-       if (celixThreadMutex_lock(framework->mutex) != 0) {
+       if (celixThreadMutex_lock(&framework->mutex) != 0) {
                fw_log(framework->logger, OSGI_FRAMEWORK_LOG_ERROR, "Error 
locking the framework, shutdown gate not set.");
                return CELIX_FRAMEWORK_EXCEPTION;
        }
        while (!framework->shutdown) {
-               apr_status_t apr_status = 
celixThreadCondition_wait(framework->shutdownGate, framework->mutex);
+               apr_status_t apr_status = 
celixThreadCondition_wait(&framework->shutdownGate, &framework->mutex);
                if (apr_status != 0) {
                        fw_log(framework->logger, OSGI_FRAMEWORK_LOG_ERROR, 
"Error waiting for shutdown gate.");
                        return CELIX_FRAMEWORK_EXCEPTION;
                }
        }
-       if (celixThreadMutex_unlock(framework->mutex) != 0) {
+       if (celixThreadMutex_unlock(&framework->mutex) != 0) {
                fw_log(framework->logger, OSGI_FRAMEWORK_LOG_ERROR, "Error 
unlocking the framework.");
                return CELIX_FRAMEWORK_EXCEPTION;
        }
@@ -1967,8 +1963,7 @@ celix_status_t framework_waitForStop(fra
        return CELIX_SUCCESS;
 }
 
-static void *APR_THREAD_FUNC framework_shutdown(apr_thread_t *thd, void 
*framework) {
-//static void * framework_shutdown(void * framework) {
+static void *framework_shutdown(void *framework) {
        framework_pt fw = (framework_pt) framework;
        hash_map_iterator_pt iterator;
        int err;
@@ -1991,17 +1986,17 @@ static void *APR_THREAD_FUNC framework_s
        }
        hashMapIterator_destroy(iterator);
 
-       err = celixThreadMutex_lock(fw->mutex);
+       err = celixThreadMutex_lock(&fw->mutex);
        if (err != 0) {
                fw_log(fw->logger, OSGI_FRAMEWORK_LOG_ERROR,  "Error locking 
the framework, cannot exit clean.");
                celixThread_exit(NULL);
                return NULL;
        }
        fw->shutdown = true;
-       err = celixThreadCondition_broadcast(fw->shutdownGate);
+       err = celixThreadCondition_broadcast(&fw->shutdownGate);
        if (err != 0) {
                fw_log(fw->logger, OSGI_FRAMEWORK_LOG_ERROR,  "Error waking the 
shutdown gate, cannot exit clean.");
-               err = celixThreadMutex_unlock(fw->mutex);
+               err = celixThreadMutex_unlock(&fw->mutex);
                if (err != 0) {
                        fw_log(fw->logger, OSGI_FRAMEWORK_LOG_ERROR,  "Error 
unlocking the framework, cannot exit clean.");
                }
@@ -2009,13 +2004,13 @@ static void *APR_THREAD_FUNC framework_s
                celixThread_exit(NULL);
                return NULL;
        }
-       err = celixThreadMutex_unlock(fw->mutex);
+       err = celixThreadMutex_unlock(&fw->mutex);
        if (err != 0) {
                fw_log(fw->logger, OSGI_FRAMEWORK_LOG_ERROR,  "Error unlocking 
the framework, cannot exit clean.");
        }
 
        fw_log(fw->logger, OSGI_FRAMEWORK_LOG_INFO, "FRAMEWORK: Shutdown 
done\n");
-       celixThread_exit(thd, APR_SUCCESS);
+       celixThread_exit((void *) CELIX_SUCCESS);
 
        return NULL;
 }
@@ -2211,7 +2206,7 @@ celix_status_t bundleActivator_stop(void
        if (bundleContext_getFramework(context, &framework) == CELIX_SUCCESS) {
 
            fw_log(framework->logger, OSGI_FRAMEWORK_LOG_INFO, "FRAMEWORK: 
Start shutdownthread");
-           if (celixThread_create(&shutdownThread, NULL, framework_shutdown, 
framework) == CELIX_SUCCESS) {
+           if (celixThread_create(&shutdownThread, NULL, &framework_shutdown, 
framework) == CELIX_SUCCESS) {
 //            celixThread_join(&status, shutdownThread);
                celixThread_detach(shutdownThread);
            } else {

Modified: incubator/celix/trunk/framework/private/src/utils.c
URL: 
http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/src/utils.c?rev=1600183&r1=1600182&r2=1600183&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/src/utils.c (original)
+++ incubator/celix/trunk/framework/private/src/utils.c Wed Jun  4 13:11:44 2014
@@ -29,6 +29,7 @@
 
 #include "utils.h"
 #include "celix_log.h"
+#include "celix_threads.h"
 
 unsigned int utils_stringHash(void * string) {
        char * str = (char *) string;
@@ -86,9 +87,9 @@ char * utils_stringTrim(char * string) {
 celix_status_t thread_equalsSelf(celix_thread_t thread, bool *equals) {
        celix_status_t status = CELIX_SUCCESS;
 
-       apr_os_thread_t self = apr_os_thread_current();
+       celix_thread_t self = celixThread_self();
        if (status == CELIX_SUCCESS) {
-               *equals = apr_os_thread_equal(self, thread);
+               *equals = celixThread_equals(self, thread);
        }
 
        return status;

Modified: incubator/celix/trunk/framework/public/include/bundle.h
URL: 
http://svn.apache.org/viewvc/incubator/celix/trunk/framework/public/include/bundle.h?rev=1600183&r1=1600182&r2=1600183&view=diff
==============================================================================
--- incubator/celix/trunk/framework/public/include/bundle.h (original)
+++ incubator/celix/trunk/framework/public/include/bundle.h Wed Jun  4 13:11:44 
2014
@@ -28,7 +28,6 @@
 #define BUNDLE_H_
 
 #include <apr_general.h>
-#include <apr_portable.h>
 
 typedef struct bundle * bundle_pt;
 
@@ -41,6 +40,7 @@ typedef struct bundle * bundle_pt;
 #include "service_reference.h"
 #include "bundle_context.h"
 #include "celix_log.h"
+#include "celix_threads.h"
 
 FRAMEWORK_EXPORT celix_status_t bundle_create(bundle_pt * bundle, 
framework_logger_pt logger, apr_pool_t *mp);
 FRAMEWORK_EXPORT celix_status_t bundle_createFromArchive(bundle_pt * bundle, 
framework_pt framework, bundle_archive_pt archive, apr_pool_t *bundlePool);
@@ -82,7 +82,7 @@ FRAMEWORK_EXPORT int compareTo(service_r
 
 FRAMEWORK_EXPORT celix_status_t bundle_getState(bundle_pt bundle, 
bundle_state_e *state);
 FRAMEWORK_EXPORT celix_status_t bundle_isLockable(bundle_pt bundle, bool 
*lockable);
-FRAMEWORK_EXPORT celix_status_t bundle_getLockingThread(bundle_pt bundle, 
apr_os_thread_t *thread);
+FRAMEWORK_EXPORT celix_status_t bundle_getLockingThread(bundle_pt bundle, 
celix_thread_t *thread);
 FRAMEWORK_EXPORT celix_status_t bundle_lock(bundle_pt bundle, bool *locked);
 FRAMEWORK_EXPORT celix_status_t bundle_unlock(bundle_pt bundle, bool 
*unlocked);
 

Modified: incubator/celix/trunk/utils/private/src/celix_threads.c
URL: 
http://svn.apache.org/viewvc/incubator/celix/trunk/utils/private/src/celix_threads.c?rev=1600183&r1=1600182&r2=1600183&view=diff
==============================================================================
--- incubator/celix/trunk/utils/private/src/celix_threads.c (original)
+++ incubator/celix/trunk/utils/private/src/celix_threads.c Wed Jun  4 13:11:44 
2014
@@ -40,7 +40,7 @@ celix_status_t celixThread_detach(celix_
     return pthread_detach(thread);
 }
 
-celix_status_t celixThread_detach(celix_thread_t thread, void **status) {
+celix_status_t celixThread_join(celix_thread_t thread, void **status) {
     return pthread_join(thread, status);
 }
 
@@ -48,10 +48,18 @@ celix_thread_t celixThread_self() {
     return pthread_self();
 }
 
+int celixThread_equals(celix_thread_t thread1, celix_thread_t thread2) {
+    return pthread_equal(thread1, thread2);
+}
+
 celix_status_t celixThreadMutex_create(celix_thread_mutex_t *mutex, 
celix_thread_mutexattr_t *attr) {
     return pthread_mutex_init(mutex, attr);
 }
 
+celix_status_t celixThreadMutex_destroy(celix_thread_mutex_t *mutex) {
+    return pthread_mutex_destroy(mutex);
+}
+
 celix_status_t celixThreadMutex_lock(celix_thread_mutex_t *mutex) {
     return pthread_mutex_lock(mutex);
 }
@@ -76,6 +84,6 @@ celix_status_t celixThreadCondition_sign
     return pthread_cond_signal(cond);
 }
 
-celix_status_t celixThreadCondition_signalThreadNp(celix_thread_cond_t *cond, 
celix_thread_t *thread) {
+celix_status_t celixThreadCondition_signalThreadNp(celix_thread_cond_t *cond, 
celix_thread_t thread) {
     return pthread_cond_signal_thread_np(cond, thread);
 }

Modified: incubator/celix/trunk/utils/public/include/celix_threads.h
URL: 
http://svn.apache.org/viewvc/incubator/celix/trunk/utils/public/include/celix_threads.h?rev=1600183&r1=1600182&r2=1600183&view=diff
==============================================================================
--- incubator/celix/trunk/utils/public/include/celix_threads.h (original)
+++ incubator/celix/trunk/utils/public/include/celix_threads.h Wed Jun  4 
13:11:44 2014
@@ -39,13 +39,15 @@ typedef void *(*celix_thread_start_t)(vo
 celix_status_t celixThread_create(celix_thread_t *new_thread, 
celix_thread_attr_t *attr, celix_thread_start_t func, void *data);
 celix_status_t celixThread_exit(void *exitStatus);
 celix_status_t celixThread_detach(celix_thread_t thread);
-celix_status_t celixThread_detach(celix_thread_t thread, void **status);
+celix_status_t celixThread_join(celix_thread_t thread, void **status);
 celix_thread_t celixThread_self();
+int celixThread_equals(celix_thread_t thread1, celix_thread_t thread2);
 
 typedef pthread_mutex_t celix_thread_mutex_t;
 typedef pthread_mutexattr_t celix_thread_mutexattr_t;
 
 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_unlock(celix_thread_mutex_t *mutex);
 
@@ -56,6 +58,6 @@ celix_status_t celixThreadCondition_init
 celix_status_t celixThreadCondition_wait(celix_thread_cond_t *cond, 
celix_thread_mutex_t *mutex);
 celix_status_t celixThreadCondition_broadcast(celix_thread_cond_t *cond);
 celix_status_t celixThreadCondition_signal(celix_thread_cond_t *cond);
-celix_status_t celixThreadCondition_signalThreadNp(celix_thread_cond_t *cond, 
celix_thread_t *thread);
+celix_status_t celixThreadCondition_signalThreadNp(celix_thread_cond_t *cond, 
celix_thread_t thread);
 
 #endif /* CELIX_THREADS_H_ */


Reply via email to