diff options
author | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-08-20 21:34:44 +0000 |
---|---|---|
committer | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-08-20 21:34:44 +0000 |
commit | 39c64117f6323ffa16bdcd14a2c907daa31c49c9 (patch) | |
tree | 2e1b05d23f1a4eaa3f6fd18a2e31b83173ce2958 /thread_sync.c | |
parent | 17e4aff277a350fa6afea31bc521c9a3f4f47353 (diff) | |
download | bundler-39c64117f6323ffa16bdcd14a2c907daa31c49c9.tar.gz |
thread*.c: avoid unnecessary initialization for list_for_each_safe
According to r52446, it is only necessary for the current item (@i),
not the `@nxt` parameter for list_for_each_safe.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64486 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread_sync.c')
-rw-r--r-- | thread_sync.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/thread_sync.c b/thread_sync.c index 7beee95910..5adb97f6b2 100644 --- a/thread_sync.c +++ b/thread_sync.c @@ -15,7 +15,7 @@ struct sync_waiter { static int wakeup_one(struct list_head *head) { - struct sync_waiter *cur = 0, *next = 0; + struct sync_waiter *cur = 0, *next; list_for_each_safe(head, cur, next, node) { list_del_init(&cur->node); @@ -31,7 +31,7 @@ wakeup_one(struct list_head *head) static void wakeup_all(struct list_head *head) { - struct sync_waiter *cur = 0, *next = 0; + struct sync_waiter *cur = 0, *next; list_for_each_safe(head, cur, next, node) { list_del_init(&cur->node); @@ -347,7 +347,7 @@ rb_mutex_unlock_th(rb_mutex_t *mutex, rb_thread_t *th) err = "Attempt to unlock a mutex which is locked by another thread"; } else { - struct sync_waiter *cur = 0, *next = 0; + struct sync_waiter *cur = 0, *next; rb_mutex_t **th_mutex = &th->keeping_mutexes; mutex->th = 0; |