* thread_pthread.c: remove GVL_DEBUG
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32168 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
ef86308a2c
commit
e623ceb9f9
@ -1,3 +1,7 @@
|
|||||||
|
Sat Jun 18 21:36:29 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
|
||||||
|
|
||||||
|
* thread_pthread.c: remove GVL_DEBUG
|
||||||
|
|
||||||
Sat Jun 18 21:32:02 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
|
Sat Jun 18 21:32:02 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
|
||||||
|
|
||||||
* vm.c, vm_core.h (rb_vm_stack_to_heap): remove const.
|
* vm.c, vm_core.h (rb_vm_stack_to_heap): remove const.
|
||||||
|
@ -40,12 +40,9 @@ static void native_cond_destroy(rb_thread_cond_t *cond);
|
|||||||
#define USE_MONOTONIC_COND 0
|
#define USE_MONOTONIC_COND 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define GVL_DEBUG 0
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
__gvl_acquire(rb_vm_t *vm)
|
__gvl_acquire(rb_vm_t *vm)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (vm->gvl.acquired) {
|
if (vm->gvl.acquired) {
|
||||||
vm->gvl.waiting++;
|
vm->gvl.waiting++;
|
||||||
while (vm->gvl.acquired) {
|
while (vm->gvl.acquired) {
|
||||||
@ -127,8 +124,6 @@ gvl_yield(rb_vm_t *vm, rb_thread_t *th)
|
|||||||
static void
|
static void
|
||||||
gvl_init(rb_vm_t *vm)
|
gvl_init(rb_vm_t *vm)
|
||||||
{
|
{
|
||||||
if (GVL_DEBUG) fprintf(stderr, "gvl init\n");
|
|
||||||
|
|
||||||
native_mutex_initialize(&vm->gvl.lock);
|
native_mutex_initialize(&vm->gvl.lock);
|
||||||
native_cond_initialize(&vm->gvl.cond, RB_CONDATTR_CLOCK_MONOTONIC);
|
native_cond_initialize(&vm->gvl.cond, RB_CONDATTR_CLOCK_MONOTONIC);
|
||||||
native_cond_initialize(&vm->gvl.switch_cond, RB_CONDATTR_CLOCK_MONOTONIC);
|
native_cond_initialize(&vm->gvl.switch_cond, RB_CONDATTR_CLOCK_MONOTONIC);
|
||||||
@ -141,14 +136,12 @@ gvl_init(rb_vm_t *vm)
|
|||||||
static void
|
static void
|
||||||
gvl_destroy(rb_vm_t *vm)
|
gvl_destroy(rb_vm_t *vm)
|
||||||
{
|
{
|
||||||
if (GVL_DEBUG) fprintf(stderr, "gvl destroy\n");
|
|
||||||
native_mutex_destroy(&vm->gvl.lock);
|
native_mutex_destroy(&vm->gvl.lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gvl_atfork(rb_vm_t *vm)
|
gvl_atfork(rb_vm_t *vm)
|
||||||
{
|
{
|
||||||
if (GVL_DEBUG) fprintf(stderr, "gvl atfork\n");
|
|
||||||
gvl_init(vm);
|
gvl_init(vm);
|
||||||
gvl_acquire(vm, GET_THREAD());
|
gvl_acquire(vm, GET_THREAD());
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user