celix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bpe...@apache.org
Subject [2/6] celix git commit: CELIX-234: prevent re-setting while reading bundle state
Date Sat, 13 Jun 2015 09:56:09 GMT
CELIX-234: prevent re-setting while reading bundle state


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

Branch: refs/heads/develop
Commit: e2598c11ab41c401fb4187a49fc77cf55a9976e6
Parents: 48e036c
Author: Bjoern Petri <bpetri@apache.org>
Authored: Fri May 15 18:09:08 2015 +0200
Committer: Bjoern Petri <bpetri@apache.org>
Committed: Fri May 15 18:09:08 2015 +0200

----------------------------------------------------------------------
 framework/private/src/framework.c | 8 ++++++++
 1 file changed, 8 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/e2598c11/framework/private/src/framework.c
----------------------------------------------------------------------
diff --git a/framework/private/src/framework.c b/framework/private/src/framework.c
index 95c86e6..3032396 100644
--- a/framework/private/src/framework.c
+++ b/framework/private/src/framework.c
@@ -2230,6 +2230,10 @@ static void *fw_eventDispatcher(void *fw) {
 			if (celixThreadMutex_lock(&framework->bundleListenerLock) != CELIX_SUCCESS) {
 				status = CELIX_FRAMEWORK_EXCEPTION;
 			}
+			else if (celixThreadMutex_lock(&framework->bundleLock) != CELIX_SUCCESS) {
+				celixThreadMutex_unlock(&framework->bundleListenerLock);
+				status = CELIX_FRAMEWORK_EXCEPTION;
+			}
 			else {
 				int i;
 				int size = arrayList_size(request->listeners);
@@ -2257,6 +2261,10 @@ static void *fw_eventDispatcher(void *fw) {
 					}
 				}
 
+				if (celixThreadMutex_unlock(&framework->bundleLock)) {
+					status = CELIX_FRAMEWORK_EXCEPTION;
+				}
+
 				if (celixThreadMutex_unlock(&framework->bundleListenerLock)) {
 					status = CELIX_FRAMEWORK_EXCEPTION;
 				}


Mime
View raw message