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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user