aboutsummaryrefslogtreecommitdiffstats
path: root/thread_sync.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-05-10 00:39:26 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-05-10 00:39:26 +0000
commitb83abc52e1d2fb022244b3f6970b9133d8ae57fe (patch)
treefe239dabe2f974c8af113bdcc2ca36ffd93d37f8 /thread_sync.c
parent4fb77a54986c2fa81b7105bc79fe9bf23c9db38a (diff)
downloadruby-b83abc52e1d2fb022244b3f6970b9133d8ae57fe.tar.gz
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 bfd625d001..e40e8c2ea8 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;
}