Project

General

Profile

Backport #1471 ยป ruby_1_8_7_thread_adjust_join.patch

Move adjust join out of wake_on into unlock_mutex_inner - JohnCarter (John Carter), 05/19/2009 02:39 PM

View differences:

bld/i686-pc-linux-gnu/src/ruby-1.8.7-p160/ruby-1.8.7-p160/ext/thread/thread.c 2009-05-18 17:33:56.697102707 +1200
205 205
    return ary;
206 206
}
207 207

  
208
static void
209
adjust_join(const List *list, VALUE new)
210
{
211
    extern void rb_thread_set_join _((VALUE, VALUE));
212
    Entry *entry;
213
    for (entry = list->entries; entry; entry = entry->next) {
214
	rb_thread_set_join(entry->value, new);
215
    }
216
}
217

  
208 218
static VALUE
209 219
wake_thread(VALUE thread)
210 220
{
......
471 481
    }
472 482

  
473 483
    waking = wake_one(&mutex->waiting);
484

  
485
    if (!NIL_P(waking)) {
486
	adjust_join(&mutex->waiting, waking);
487
    }
488

  
474 489
    mutex->owner = waking;
475 490

  
476 491
    return waking;