mirror of
https://github.com/ruby/ruby.git
synced 2025-08-23 13:04:13 +02:00
Better handling of root fiber.
This commit is contained in:
parent
7c7a1c2212
commit
38791145eb
3 changed files with 18 additions and 18 deletions
7
cont.c
7
cont.c
|
@ -420,10 +420,7 @@ cont_free(void *ptr)
|
|||
rb_fiber_t *fib = (rb_fiber_t*)cont;
|
||||
#if defined(FIBER_USE_COROUTINE)
|
||||
coroutine_destroy(&fib->context);
|
||||
if (fib->ss_sp != NULL) {
|
||||
if (fiber_is_root_p(fib)) {
|
||||
rb_bug("Illegal root fiber parameter");
|
||||
}
|
||||
if (fib->ss_sp != NULL && !fiber_is_root_p(fib)) {
|
||||
#ifdef _WIN32
|
||||
VirtualFree((void*)fib->ss_sp, 0, MEM_RELEASE);
|
||||
#else
|
||||
|
@ -1661,6 +1658,8 @@ rb_threadptr_root_fiber_setup(rb_thread_t *th)
|
|||
fiber_status_set(fib, FIBER_RESUMED); /* skip CREATED */
|
||||
th->ec = &fib->cont.saved_ec;
|
||||
|
||||
th->root_fiber = fib;
|
||||
|
||||
/* NOTE: On WIN32, fib_handle is not allocated yet. */
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue