summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-11-28 05:48:31 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-11-28 05:48:31 +0000
commit925da00b022b05b5bf70e5d757b9149493e6946c (patch)
tree078dfc039745fe700b2477d9564303339fc4c64f
parent079545cd8c7a2c0da45977bec7d88aa3d1232820 (diff)
* thread_pthread.c (gvl_release, gvl_init): suppress warnings.
* vm_core.h (rb_vm_gvl_destroy): add prototype. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29958 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog8
-rw-r--r--thread_pthread.c6
-rw-r--r--vm_core.h1
3 files changed, 12 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index cb11c2c985..124bebf076 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Sun Nov 28 14:48:24 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * thread_pthread.c (gvl_release, gvl_init): suppress warnings.
+
+ * vm_core.h (rb_vm_gvl_destroy): add prototype.
+
Sun Nov 28 14:46:24 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
* thread_pthread.c (gvl_reinit): register atfork hander only in
@@ -15,7 +21,7 @@ Sun Nov 28 12:23:57 2010 Koichi Sasada <ko1@atdot.net>
this causes some issues such as priority inversion and so on.)
This impl. prevents spin-loop (*1) caused on SMP environemnts.
*1: Only one Ruby thread acqures GVL again and again.
- Bug #2359 [ruby-core:26694]
+ Bug #2359 [ruby-core:26694]
* thread_win32.c, thread_win32.h: Using simple lock
not by CRITICAL_SECTION but by Mutex.
diff --git a/thread_pthread.c b/thread_pthread.c
index 9966943f8e..8a10d3a217 100644
--- a/thread_pthread.c
+++ b/thread_pthread.c
@@ -29,7 +29,7 @@ static void native_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex);
static void native_cond_initialize(pthread_cond_t *cond);
static void native_cond_destroy(pthread_cond_t *cond);
-static void native_atfork(void (*prepare)(void), void (*parent)(void), void (*child)(void));
+static void native_atfork(void (*prepare)(void), void (*parent)(void), void (*child)(void));
#define native_mutex_reinitialize_atfork(lock) (\
native_mutex_unlock(lock), \
@@ -50,6 +50,7 @@ gvl_show_waiting_threads(rb_vm_t *vm)
}
}
+#if !GVL_SIMPLE_LOCK
static void
gvl_waiting_push(rb_vm_t *vm, rb_thread_t *th)
{
@@ -73,6 +74,7 @@ gvl_waiting_shift(rb_vm_t *vm, rb_thread_t *th)
vm->gvl.waiting_threads = vm->gvl.waiting_threads->native_thread_data.gvl_next;
vm->gvl.waiting--;
}
+#endif
static void
gvl_acquire(rb_vm_t *vm, rb_thread_t *th)
@@ -114,7 +116,7 @@ gvl_release(rb_vm_t *vm)
native_cond_signal(&th->native_thread_data.gvl_cond);
}
else {
- if (GVL_DEBUG) fprintf(stderr, "gvl release (%p): wakeup: %p\n", GET_THREAD(), 0);
+ if (GVL_DEBUG) fprintf(stderr, "gvl release (%p): wakeup: %p\n", GET_THREAD(), NULL);
/* do nothing */
}
vm->gvl.acquired = 0;
diff --git a/vm_core.h b/vm_core.h
index f32c33e5ec..0ff54f2216 100644
--- a/vm_core.h
+++ b/vm_core.h
@@ -639,6 +639,7 @@ VALUE rb_vm_invoke_proc(rb_thread_t *th, rb_proc_t *proc, VALUE self,
int argc, const VALUE *argv, const rb_block_t *blockptr);
VALUE rb_vm_make_proc(rb_thread_t *th, const rb_block_t *block, VALUE klass);
VALUE rb_vm_make_env_object(rb_thread_t *th, rb_control_frame_t *cfp);
+void rb_vm_gvl_destroy(rb_vm_t *vm);
void rb_thread_start_timer_thread(void);
void rb_thread_stop_timer_thread(void);