summaryrefslogtreecommitdiff
path: root/vm_core.h
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-23 09:53:14 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-23 09:53:14 +0000
commitbd058912da6ffef92a50fe759b1bae210ec82ea4 (patch)
tree6acbe02fa09f9dd60974ef76c5147dcfbab83718 /vm_core.h
parent374219291946885509dac502230c1084b0058238 (diff)
* thread_native.h: added.
Move native thread related lines from vm_core.h. And declare several functions "rb_nativethread_lock_*", manipulate locking. * common.mk: add thread_native.h. * thread.c: add functions "rb_nativethread_lock_*". * thraed.c, thread_[pthread,win32].[ch]: rename rb_thread_lock_t to rb_nativethread_lock_t to make it clear that this lock is for native thraeds, not for ruby threads. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42133 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_core.h')
-rw-r--r--vm_core.h15
1 files changed, 3 insertions, 12 deletions
diff --git a/vm_core.h b/vm_core.h
index a02205a624..0227339231 100644
--- a/vm_core.h
+++ b/vm_core.h
@@ -24,13 +24,7 @@
#include "method.h"
#include "ruby_atomic.h"
-#if defined(_WIN32)
-#include "thread_win32.h"
-#elif defined(HAVE_PTHREAD_H)
-#include "thread_pthread.h"
-#else
-#error "unsupported thread type"
-#endif
+#include "thread_native.h"
#ifndef ENABLE_VM_OBJSPACE
#ifdef _WIN32
@@ -341,7 +335,7 @@ typedef struct rb_vm_struct {
VALUE self;
rb_global_vm_lock_t gvl;
- rb_thread_lock_t thread_destruct_lock;
+ rb_nativethread_lock_t thread_destruct_lock;
struct rb_thread_struct *main_thread;
struct rb_thread_struct *running_thread;
@@ -558,7 +552,7 @@ typedef struct rb_thread_struct {
rb_atomic_t interrupt_flag;
unsigned long interrupt_mask;
- rb_thread_lock_t interrupt_lock;
+ rb_nativethread_lock_t interrupt_lock;
rb_thread_cond_t interrupt_cond;
struct rb_unblock_callback unblock;
VALUE locking_mutex;
@@ -931,9 +925,6 @@ void rb_threadptr_pending_interrupt_clear(rb_thread_t *th);
void rb_threadptr_pending_interrupt_enque(rb_thread_t *th, VALUE v);
int rb_threadptr_pending_interrupt_active_p(rb_thread_t *th);
-void rb_thread_lock_unlock(rb_thread_lock_t *);
-void rb_thread_lock_destroy(rb_thread_lock_t *);
-
#define RUBY_VM_CHECK_INTS_BLOCKING(th) do { \
if (UNLIKELY(!rb_threadptr_pending_interrupt_empty_p(th))) { \
th->pending_interrupt_queue_checked = 0; \