Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
8ae70731
Commit
8ae70731
authored
Nov 07, 2022
by
Brendan Shanks
Committed by
Alexandre Julliard
Nov 18, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Add native thread renaming for macOS.
parent
ca4c6f11
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
0 deletions
+38
-0
thread.c
dlls/ntdll/unix/thread.c
+38
-0
No files found.
dlls/ntdll/unix/thread.c
View file @
8ae70731
...
...
@@ -59,6 +59,10 @@
#include <libprocstat.h>
#endif
#ifdef __APPLE__
#include <mach/mach.h>
#endif
#define NONAMELESSUNION
#define NONAMELESSSTRUCT
#include "ntstatus.h"
...
...
@@ -1876,6 +1880,40 @@ static void set_native_thread_name( HANDLE handle, const UNICODE_STRING *name )
write
(
fd
,
nameA
,
len
);
close
(
fd
);
}
#elif defined(__APPLE__)
/* pthread_setname_np() silently fails if the name is longer than 63 characters + null terminator */
char
nameA
[
64
];
NTSTATUS
status
;
int
unix_pid
,
unix_tid
,
len
,
current_tid
;
SERVER_START_REQ
(
get_thread_times
)
{
req
->
handle
=
wine_server_obj_handle
(
handle
);
status
=
wine_server_call
(
req
);
if
(
status
==
STATUS_SUCCESS
)
{
unix_pid
=
reply
->
unix_pid
;
unix_tid
=
reply
->
unix_tid
;
}
}
SERVER_END_REQ
;
if
(
status
!=
STATUS_SUCCESS
||
unix_pid
==
-
1
||
unix_tid
==
-
1
)
return
;
current_tid
=
mach_thread_self
();
mach_port_deallocate
(
mach_task_self
(),
current_tid
);
if
(
unix_tid
!=
current_tid
)
{
static
int
once
;
if
(
!
once
++
)
FIXME
(
"setting other thread name not supported
\n
"
);
return
;
}
len
=
ntdll_wcstoumbs
(
name
->
Buffer
,
name
->
Length
/
sizeof
(
WCHAR
),
nameA
,
sizeof
(
nameA
)
-
1
,
FALSE
);
nameA
[
len
]
=
'\0'
;
pthread_setname_np
(
nameA
);
#else
static
int
once
;
if
(
!
once
++
)
FIXME
(
"not implemented on this platform
\n
"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment