Commit 84760a8f authored by Ken Thomases's avatar Ken Thomases Committed by Alexandre Julliard

ntdll: On Mac, use the Mach API as preferred approach to get a thread's GS.base.

The previous technique was a gross hack peeking at the internals of the pthreads implementation. Signed-off-by: 's avatarKen Thomases <ken@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 06754af1
......@@ -3204,9 +3204,18 @@ void signal_free_thread( TEB *teb )
*/
static void *mac_thread_gsbase(void)
{
struct thread_identifier_info tiinfo;
unsigned int info_count = THREAD_IDENTIFIER_INFO_COUNT;
static int gsbase_offset = -1;
void *ret;
kern_return_t kr = thread_info(mach_thread_self(), THREAD_IDENTIFIER_INFO, (thread_identifier_info_t) &tiinfo, &info_count);
if (kr == KERN_SUCCESS)
{
TRACE("pthread_self() %p thread ID %lx gsbase %lx\n", pthread_self(), tiinfo.thread_id, tiinfo.thread_handle);
return (void*)tiinfo.thread_handle;
}
if (gsbase_offset < 0)
{
/* Search for the array of TLS slots within the pthread data structure.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment