Permalink
Browse files

* thread_native.h: add rb_nativethread_self() which returns

  current running native thread identifier.
* thread_[pthread|win32].c: implement rb_nativethread_self().



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42137 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information...
1 parent 2b1088c commit b2bcef7294d1a65363773cfc97ade6bd286ee63a @ko1 ko1 committed Jul 23, 2013
Showing with 22 additions and 0 deletions.
  1. +7 −0 ChangeLog
  2. +2 −0 thread_native.h
  3. +6 −0 thread_pthread.c
  4. +7 −0 thread_win32.c
View
@@ -1,3 +1,10 @@
+Tue Jul 23 19:44:32 2013 Koichi Sasada <ko1@atdot.net>
+
+ * thread_native.h: add rb_nativethread_self() which returns
+ current running native thread identifier.
+
+ * thread_[pthread|win32].c: implement rb_nativethread_self().
+
Tue Jul 23 19:34:11 2013 Koichi Sasada <ko1@atdot.net>
* thread_pthread.h, thread_win32.h: rename rb_thread_id_t to
View
@@ -11,6 +11,8 @@
RUBY_SYMBOL_EXPORT_BEGIN
+rb_nativethread_id_t rb_nativethread_self();
+
void rb_nativethread_lock_initialize(rb_nativethread_lock_t *lock);
void rb_nativethread_lock_destroy(rb_nativethread_lock_t *lock);
void rb_nativethread_lock_lock(rb_nativethread_lock_t *lock);
View
@@ -1535,4 +1535,10 @@ rb_reserved_fd_p(int fd)
#endif
}
+rb_nativethread_id_t
+rb_nativethread_self(void)
+{
+ return pthread_self();
+}
+
#endif /* THREAD_SYSTEM_DEPENDENT_IMPLEMENTATION */
View
@@ -766,4 +766,11 @@ rb_reserved_fd_p(int fd)
{
return 0;
}
+
+rb_nativethread_id_t
+rb_nativethread_self(void)
+{
+ return GetCurrentThread();
+}
+
#endif /* THREAD_SYSTEM_DEPENDENT_IMPLEMENTATION */

0 comments on commit b2bcef7

Please sign in to comment.