* cont.c (fiber_initialize_machine_stack_context): try to release

unnecessary fibers and retry to create.  based on a patch from
  masaya tarui at [ruby-dev:41230].


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27701 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2010-05-09 07:28:17 +00:00
Родитель 1b979ea721
Коммит d4fb3227f9
2 изменённых файлов: 14 добавлений и 0 удалений

Просмотреть файл

@ -1,3 +1,9 @@
Sun May 9 16:28:15 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
* cont.c (fiber_initialize_machine_stack_context): try to release
unnecessary fibers and retry to create. based on a patch from
masaya tarui at [ruby-dev:41230].
Sun May 9 08:32:56 2010 NARUSE, Yui <naruse@ruby-lang.org>
* ext/json/generator/generator.c (fbuffer_inc_capa):

8
cont.c
Просмотреть файл

@ -548,6 +548,14 @@ fiber_initialize_machine_stack_context(rb_fiber_t *fib, size_t size)
#ifdef _WIN32
fib->fib_handle = CreateFiberEx(size - 1, size, 0, fiber_entry, NULL);
if (!fib->fib_handle) {
/* try to release unnecessary fibers & retry to create */
rb_gc();
fib->fib_handle = CreateFiberEx(size - 1, size, 0, fiber_entry, NULL);
if (!fib->fib_handle) {
rb_raise(rb_eFiberError, "can't create fiber");
}
}
#else /* not WIN32 */
ucontext_t *context = &fib->context;
VALUE *ptr;