diff options
author | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-05-16 21:54:42 +0000 |
---|---|---|
committer | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-05-16 21:54:42 +0000 |
commit | 0f0311df0a31fce8ceab3ef9dffead0c67629dbe (patch) | |
tree | b2275b92427d8f4120b79f8c29360c2997c3b4d3 /thread_pthread.c | |
parent | a3e73d13c1572c7539eff239954f992e9eef9eed (diff) |
thread: reduce GET_THREAD calls
This allows native_sleep to use less stack (80 -> 64 bytes on
x86-64) for GVL_UNLOCK_BEGIN/END. For future APIs, we will pass
`ec` or `th` around anyways, so the BLOCKING_REGION change
should be beneficial in the future.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63448 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread_pthread.c')
-rw-r--r-- | thread_pthread.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/thread_pthread.c b/thread_pthread.c index 6337620e8a..775c32a6a7 100644 --- a/thread_pthread.c +++ b/thread_pthread.c @@ -1044,7 +1044,7 @@ native_sleep(rb_thread_t *th, struct timespec *timeout_rel) timeout = native_cond_timeout(cond, *timeout_rel); } - GVL_UNLOCK_BEGIN(); + GVL_UNLOCK_BEGIN(th); { rb_native_mutex_lock(lock); th->unblock.func = ubf_pthread_cond_signal; @@ -1065,7 +1065,7 @@ native_sleep(rb_thread_t *th, struct timespec *timeout_rel) rb_native_mutex_unlock(lock); } - GVL_UNLOCK_END(); + GVL_UNLOCK_END(th); thread_debug("native_sleep done\n"); } |