Commit 07d005de authored by Ken Thomases's avatar Ken Thomases Committed by Alexandre Julliard

ntdll: Mac: Fix leak of send right for Mach thread port.

The leaked send right kept the port alive for threads that are gone. For processes which create a lot of threads, this can cause performance problems.
parent 62019e6d
...@@ -942,6 +942,7 @@ static int get_unix_tid(void) ...@@ -942,6 +942,7 @@ static int get_unix_tid(void)
ret = pthread_self(); ret = pthread_self();
#elif defined(__APPLE__) #elif defined(__APPLE__)
ret = mach_thread_self(); ret = mach_thread_self();
mach_port_deallocate(mach_task_self(), ret);
#elif defined(__FreeBSD__) #elif defined(__FreeBSD__)
long lwpid; long lwpid;
thr_self( &lwpid ); thr_self( &lwpid );
......
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