summaryrefslogtreecommitdiff
path: root/thread_sync.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-05-10 00:39:26 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-05-10 00:39:26 (GMT)
commit6924066a65f923a61f31bdc910b57ca9606715b0 (patch)
treefe239dabe2f974c8af113bdcc2ca36ffd93d37f8 /thread_sync.c
parent7573452099e010ccf5ac26cb56e0172046671f91 (diff)
adjust styles [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58646 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread_sync.c')
-rw-r--r--thread_sync.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/thread_sync.c b/thread_sync.c
index bfd625d..e40e8c2 100644
--- a/thread_sync.c
+++ b/thread_sync.c
@@ -298,7 +298,8 @@ rb_mutex_unlock_th(rb_mutex_t *mutex, rb_thread_t volatile *th)
}
else if (mutex->th != th) {
err = "Attempt to unlock a mutex which is locked by another thread";
- } else {
+ }
+ else {
struct mutex_waiter *cur = 0, *next = 0;
rb_mutex_t *volatile *th_mutex = &th->keeping_mutexes;
@@ -306,19 +307,19 @@ rb_mutex_unlock_th(rb_mutex_t *mutex, rb_thread_t volatile *th)
list_for_each_safe(&mutex->waitq, cur, next, node) {
list_del_init(&cur->node);
switch (cur->th->status) {
- case THREAD_RUNNABLE: /* from someone else calling Thread#run */
- case THREAD_STOPPED_FOREVER: /* likely (rb_mutex_lock) */
+ case THREAD_RUNNABLE: /* from someone else calling Thread#run */
+ case THREAD_STOPPED_FOREVER: /* likely (rb_mutex_lock) */
rb_threadptr_interrupt(cur->th);
goto found;
- case THREAD_STOPPED: /* probably impossible */
+ case THREAD_STOPPED: /* probably impossible */
rb_bug("unexpected THREAD_STOPPED");
- case THREAD_KILLED:
+ case THREAD_KILLED:
/* not sure about this, possible in exit GC? */
rb_bug("unexpected THREAD_KILLED");
continue;
}
}
-found:
+ found:
while (*th_mutex != mutex) {
th_mutex = &(*th_mutex)->next_mutex;
}