Added get_pthread_thread_id() function returning the Haiku thread_id of a

pthread.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33927 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2009-11-07 08:19:24 +00:00
parent 72e3211d51
commit 9c7b2520c2
2 changed files with 18 additions and 0 deletions
+8
View File
@@ -7,6 +7,7 @@
//! Kernel specific structures and functions
#include <pthread.h>
#include <stdarg.h>
#include <SupportDefs.h>
@@ -350,6 +351,13 @@ extern status_t _get_next_thread_info(team_id team, int32 *cookie,
#define get_next_thread_info(team, cookie, info) \
_get_next_thread_info((team), (cookie), (info), sizeof(*(info)))
/* bridge to the pthread API */
extern thread_id get_pthread_thread_id(pthread_t thread);
/* TODO: Would be nice to have, but we use TLS to associate a thread with its
pthread object. So this is not trivial to implement.
extern status_t convert_to_pthread(thread_id thread, pthread_t *_thread);
*/
/* Time */
@@ -232,3 +232,13 @@ pthread_setconcurrency(int newLevel)
sConcurrencyLevel = newLevel;
return 0;
}
// #pragma mark - Haiku thread API bridge
thread_id
get_pthread_thread_id(pthread_t thread)
{
return thread->id;
}