diff options
-rw-r--r-- | firmware/kernel.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/firmware/kernel.c b/firmware/kernel.c index 4e56c2919a..006a06dfe0 100644 --- a/firmware/kernel.c +++ b/firmware/kernel.c | |||
@@ -1076,7 +1076,13 @@ void mutex_unlock(struct mutex *m) | |||
1076 | #endif | 1076 | #endif |
1077 | 1077 | ||
1078 | /* transfer to next queued thread if any */ | 1078 | /* transfer to next queued thread if any */ |
1079 | m->thread = wakeup_thread_no_listlock(&m->queue); | 1079 | |
1080 | /* This can become busy using SWP but is safe since only one thread | ||
1081 | will be changing things at a time. Allowing timeout waits will | ||
1082 | change that however but not now. There is also a hazard the thread | ||
1083 | could be killed before performing the wakeup but that's just | ||
1084 | irresponsible. :-) */ | ||
1085 | m->thread = m->queue; | ||
1080 | 1086 | ||
1081 | if(m->thread == NULL) | 1087 | if(m->thread == NULL) |
1082 | { | 1088 | { |
@@ -1087,6 +1093,7 @@ void mutex_unlock(struct mutex *m) | |||
1087 | } | 1093 | } |
1088 | else /* another thread is waiting - remain locked */ | 1094 | else /* another thread is waiting - remain locked */ |
1089 | { | 1095 | { |
1096 | wakeup_thread_no_listlock(&m->queue); | ||
1090 | #if CONFIG_CORELOCK == SW_CORELOCK | 1097 | #if CONFIG_CORELOCK == SW_CORELOCK |
1091 | corelock_unlock(&m->cl); | 1098 | corelock_unlock(&m->cl); |
1092 | #elif CONFIG_CORELOCK == CORELOCK_SWAP | 1099 | #elif CONFIG_CORELOCK == CORELOCK_SWAP |