From 86cede157a8875c5f6f1bb395c4213675c6c8cbe Mon Sep 17 00:00:00 2001 From: Bryce McKinlay Date: Wed, 21 Jun 2006 16:27:14 +0000 Subject: [PATCH] win32-threads.h (_Jv_ThreadDesc_t): New typedef. 2006-06-21 Bryce McKinlay * include/win32-threads.h (_Jv_ThreadDesc_t): New typedef. (_Jv_GetPlatformThreadID): New function. * include/posix-threads.h (_Jv_ThreadDesc_t): New typedef. (_Jv_GetPlatformThreadID): New function. From-SVN: r114854 --- libjava/ChangeLog | 7 +++++++ libjava/include/posix-threads.h | 10 +++++++++- libjava/include/win32-threads.h | 9 +++++++++ 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 39020de511c..c1dcf661140 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,10 @@ +2006-06-21 Bryce McKinlay + + * include/win32-threads.h (_Jv_ThreadDesc_t): New typedef. + (_Jv_GetPlatformThreadID): New function. + * include/posix-threads.h (_Jv_ThreadDesc_t): New typedef. + (_Jv_GetPlatformThreadID): New function. + 2006-06-20 Bryce McKinlay * gnu/classpath/natSystemProperties.cc (insertSystemProperties): diff --git a/libjava/include/posix-threads.h b/libjava/include/posix-threads.h index fe648b79c0c..41adea3e022 100644 --- a/libjava/include/posix-threads.h +++ b/libjava/include/posix-threads.h @@ -47,7 +47,6 @@ typedef struct _Jv_Thread_t typedef void _Jv_ThreadStartFunc (java::lang::Thread *); - // Condition Variables used to implement wait/notify/sleep/interrupt. typedef struct { @@ -82,6 +81,15 @@ _Jv_MutexCheckMonitor (_Jv_Mutex_t *mu) return (mu->owner != pthread_self()); } +// Type identifying a POSIX thread. +typedef pthread_t _Jv_ThreadDesc_t; + +inline _Jv_ThreadDesc_t +_Jv_GetPlatformThreadID(_Jv_Thread_t *t) +{ + return t->thread; +} + // // Condition variables. // diff --git a/libjava/include/win32-threads.h b/libjava/include/win32-threads.h index 4089b223ddb..b280b8f3969 100644 --- a/libjava/include/win32-threads.h +++ b/libjava/include/win32-threads.h @@ -72,6 +72,15 @@ _Jv_ThreadSelf (void) typedef void _Jv_ThreadStartFunc (java::lang::Thread *); +// Type identifying a win32 thread. +typedef HANDLE _Jv_ThreadDesc_t; + +inline _Jv_ThreadDesc_t +_Jv_GetPlatformThreadID(_Jv_Thread_t *t) +{ + return t->handle; +} + // // Condition variables. //