Skip to content
Permalink
Browse files
Merge pull request #402 from apache/hotfix/framework_shutdown_deadlock
Fix a first-check-then-do race condition during framework shutdown.
  • Loading branch information
PengZheng committed Mar 18, 2022
2 parents 3b651da + aa98685 commit c83bc0790d192098be10c769d10ac941516fc17d
Showing 1 changed file with 1 addition and 1 deletion.
@@ -1591,7 +1591,7 @@ static inline bool fw_removeTopEventFromQueue(celix_framework_t* fw) {
static inline void fw_handleEvents(celix_framework_t* framework) {
celixThreadMutex_lock(&framework->dispatcher.mutex);
int size = framework->dispatcher.eventQueueSize + celix_arrayList_size(framework->dispatcher.dynamicEventQueue);
if (size == 0) {
if (size == 0 && framework->dispatcher.active) {
celixThreadCondition_timedwaitRelative(&framework->dispatcher.cond, &framework->dispatcher.mutex, 1, 0);
}
size = framework->dispatcher.eventQueueSize + celix_arrayList_size(framework->dispatcher.dynamicEventQueue);

0 comments on commit c83bc07

Please sign in to comment.