aboutsummaryrefslogtreecommitdiffstats
path: root/vm_core.h
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-06-11 08:38:09 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-06-11 08:38:09 +0000
commitdfd8c5d4020131798d3fe52bb6a0c973422aded2 (patch)
tree71e12951745cde99de92fd7cd79bf3c90052afff /vm_core.h
parente2b10b6d131425c395c5fe286ce6fd55d46f7c51 (diff)
downloadruby-dfd8c5d4020131798d3fe52bb6a0c973422aded2.tar.gz
thread.c: fix for non-scalar pthread_t
* configure.in (rb_cv_scalar_pthread_t): pthread_t is not required to be a scalar type. * thread.c (fill_thread_id_string, thread_id_str): dump pthread_t in hexadecimal form if it is not a scalar type, assume it can be represented in a pointer form otherwise. based on the patch by Rei Odaira at [ruby-core:62867]. [ruby-core:62857] [Bug #9884] * thread_pthread.c (Init_native_thread, thread_start_func_1), (native_thread_create): set thread_id_str if needed. * vm_core.h (rb_thread_t): add thread_id_string if needed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46406 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_core.h')
-rw-r--r--vm_core.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/vm_core.h b/vm_core.h
index dfce1785ac..bc221a74cb 100644
--- a/vm_core.h
+++ b/vm_core.h
@@ -507,6 +507,8 @@ typedef struct rb_ensure_list {
struct rb_ensure_entry entry;
} rb_ensure_list_t;
+typedef char rb_thread_id_string_t[sizeof(rb_nativethread_id_t) * 2 + 3];
+
typedef struct rb_thread_struct {
struct list_node vmlt_node;
VALUE self;
@@ -546,6 +548,9 @@ typedef struct rb_thread_struct {
/* thread control */
rb_nativethread_id_t thread_id;
+#ifdef NON_SCALAR_THREAD_ID
+ rb_thread_id_string_t thread_id_string;
+#endif
enum rb_thread_status status;
int to_kill;
int priority;