diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-06-28 04:49:30 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-06-28 04:49:30 +0000 |
commit | bc648b12cbb35a8a553e7cc47ed2b4ba01906cbb (patch) | |
tree | c0ee96bf9da5df9607397c841b2b7953a41d4c04 /vm_core.h | |
parent | 87afbe4685bf5d39d94e312b78515d50b9364f4d (diff) | |
download | ruby-bc648b12cbb35a8a553e7cc47ed2b4ba01906cbb.tar.gz |
introduce rb_thread_ptr() to replace GetThreadPtr().
* vm_core.h (rb_thread_ptr): added to replace GetThreadPtr() macro.
* thread.c (in some functions: use "target_th" instead of "th" to make clear
that it is not a current thread.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59192 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_core.h')
-rw-r--r-- | vm_core.h | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -672,8 +672,12 @@ typedef struct rb_control_frame_struct { extern const rb_data_type_t ruby_threadptr_data_type; -#define GetThreadPtr(obj, ptr) \ - TypedData_Get_Struct((obj), rb_thread_t, &ruby_threadptr_data_type, (ptr)) +static inline struct rb_thread_struct * +rb_thread_ptr(VALUE thval) +{ + VM_ASSERT(rb_check_typeddata(obj, &ruby_threadptr_data_type) != NULL); + return (struct rb_thread_struct *)DATA_PTR(thval); +} enum rb_thread_status { THREAD_RUNNABLE, |