summaryrefslogtreecommitdiff
path: root/thread.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2021-06-01 22:27:13 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2021-06-01 22:27:13 +0900
commit9024c7f1bb3ea432a2b52e7c701b06f83aafd4d5 (patch)
tree0b52d7bc67fde0fcfd4fb30bd2f91c121b0e7b49 /thread.c
parent6e7e9a80adfe69e6e6d20e01997b97a5c24cd33e (diff)
Make `Thread#native_thread_id` not-implemented if unsupported
Raise `NotImplementedError` on unsupported platforms regardless the argument consistently.
Diffstat (limited to 'thread.c')
-rw-r--r--thread.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/thread.c b/thread.c
index e36ea6110b..419bf09151 100644
--- a/thread.c
+++ b/thread.c
@@ -3402,6 +3402,7 @@ rb_thread_setname(VALUE thread, VALUE name)
return name;
}
+#if USE_NATIVE_THREAD_NATIVE_THREAD_ID
/*
* call-seq:
* thr.native_thread_id -> integer
@@ -3431,6 +3432,9 @@ rb_thread_native_thread_id(VALUE thread)
if (rb_threadptr_dead(target_th)) return Qnil;
return native_thread_native_thread_id(target_th);
}
+#else
+# define rb_thread_native_thread_id rb_f_notimplement
+#endif
/*
* call-seq: