incubator-celix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bpe...@apache.org
Subject svn commit: r1601257 - /incubator/celix/trunk/log_service/private/src/log.c
Date Sun, 08 Jun 2014 20:55:11 GMT
Author: bpetri
Date: Sun Jun  8 20:55:11 2014
New Revision: 1601257

URL: http://svn.apache.org/r1601257
Log:
CELIX-114

Patch committed for potential deadlock



Modified:
    incubator/celix/trunk/log_service/private/src/log.c

Modified: incubator/celix/trunk/log_service/private/src/log.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/log_service/private/src/log.c?rev=1601257&r1=1601256&r2=1601257&view=diff
==============================================================================
--- incubator/celix/trunk/log_service/private/src/log.c (original)
+++ incubator/celix/trunk/log_service/private/src/log.c Sun Jun  8 20:55:11 2014
@@ -285,14 +285,10 @@ static celix_status_t log_stopListenerTh
     celix_status_t status = CELIX_SUCCESS;
     apr_status_t apr_status = APR_SUCCESS;
 
-    if (apr_status != APR_SUCCESS) {
+    logger->running = false;
+    status = apr_thread_cond_signal(logger->entriesToDeliver);
+    if (status != APR_SUCCESS) {
         status = CELIX_SERVICE_EXCEPTION;
-    } else {
-        logger->running = false;
-        status = apr_thread_cond_signal(logger->entriesToDeliver);
-        if (status != APR_SUCCESS) {
-            status = CELIX_SERVICE_EXCEPTION;
-        }
     }
 
     return status;
@@ -330,7 +326,7 @@ void * APR_THREAD_FUNC log_listenerThrea
                 }
             }
 
-            if (arrayList_isEmpty(logger->listenerEntries)) {
+            if (arrayList_isEmpty(logger->listenerEntries) && logger->running)
{
                 apr_thread_cond_wait(logger->entriesToDeliver, logger->deliverLock);
             }
 



Mime
View raw message