зеркало из https://github.com/github/ruby.git
thread_sync.rb (rb_condvar_wait): golf out unnecessary variables
GCC is smart enough to optimize these away, but my attention span is too short :{ git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64474 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
6343dd4a03
Коммит
883422b191
|
@ -1383,14 +1383,11 @@ static VALUE
|
|||
rb_condvar_wait(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
struct rb_condvar *cv = condvar_ptr(self);
|
||||
VALUE mutex, timeout;
|
||||
struct sleep_call args;
|
||||
struct sync_waiter w;
|
||||
|
||||
rb_scan_args(argc, argv, "11", &mutex, &timeout);
|
||||
rb_scan_args(argc, argv, "11", &args.mutex, &args.timeout);
|
||||
|
||||
args.mutex = mutex;
|
||||
args.timeout = timeout;
|
||||
w.th = GET_THREAD();
|
||||
list_add_tail(&cv->waitq, &w.node);
|
||||
rb_ensure(do_sleep, (VALUE)&args, delete_from_waitq, (VALUE)&w);
|
||||
|
|
Загрузка…
Ссылка в новой задаче