mirror of
https://github.com/ruby/ruby.git
synced 2025-09-17 01:23:57 +02:00
* 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/branches/ruby_1_9_2@27701 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
af712edd5f
commit
d17f0a84d9
2 changed files with 14 additions and 0 deletions
|
@ -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>
|
Sun May 9 08:32:56 2010 NARUSE, Yui <naruse@ruby-lang.org>
|
||||||
|
|
||||||
* ext/json/generator/generator.c (fbuffer_inc_capa):
|
* ext/json/generator/generator.c (fbuffer_inc_capa):
|
||||||
|
|
8
cont.c
8
cont.c
|
@ -548,6 +548,14 @@ fiber_initialize_machine_stack_context(rb_fiber_t *fib, size_t size)
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
fib->fib_handle = CreateFiberEx(size - 1, size, 0, fiber_entry, NULL);
|
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 */
|
#else /* not WIN32 */
|
||||||
ucontext_t *context = &fib->context;
|
ucontext_t *context = &fib->context;
|
||||||
VALUE *ptr;
|
VALUE *ptr;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue