Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
dav1d
Manage
Activity
Members
Labels
Plan
Issues
25
Issue boards
Milestones
Wiki
Code
Merge requests
13
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VideoLAN
dav1d
Commits
fa32f2de
Commit
fa32f2de
authored
5 years ago
by
Henrik Gramner
Committed by
Henrik Gramner
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Set thread names on MacOS
parent
6c3e85de
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!754
Set thread names on Windows and MacOS
Pipeline
#8788
passed with stages
in 7 minutes and 46 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
meson.build
+6
-1
6 additions, 1 deletion
meson.build
src/thread.h
+9
-3
9 additions, 3 deletions
src/thread.h
with
15 additions
and
4 deletions
meson.build
+
6
−
1
View file @
fa32f2de
...
...
@@ -85,9 +85,14 @@ test_args = []
optional_arguments
=
[]
# Define _POSIX_C_SOURCE to POSIX.1–2001 (IEEE Std 1003.1-2001)
test_args
+=
'-D_POSIX_C_SOURCE=200112L'
test_args
+=
'-D_POSIX_C_SOURCE=200112L'
add_project_arguments
(
'-D_POSIX_C_SOURCE=200112L'
,
language
:
'c'
)
if
host_machine
.
system
()
==
'darwin'
test_args
+=
'-D_DARWIN_C_SOURCE'
add_project_arguments
(
'-D_DARWIN_C_SOURCE'
,
language
:
'c'
)
endif
if
host_machine
.
system
()
==
'windows'
cdata
.
set
(
'_WIN32_WINNT'
,
'0x0601'
)
cdata
.
set
(
'UNICODE'
,
1
)
# Define to 1 for Unicode (Wide Chars) APIs
...
...
This diff is collapsed.
Click to expand it.
src/thread.h
+
9
−
3
View file @
fa32f2de
...
...
@@ -138,10 +138,16 @@ static inline int pthread_cond_broadcast(pthread_cond_t *const cond) {
#include
<sys/prctl.h>
static
inline
void
dav1d_set_thread_name
(
const
char
*
name
)
{
static
inline
void
dav1d_set_thread_name
(
const
char
*
const
name
)
{
prctl
(
PR_SET_NAME
,
name
);
}
#elif defined(__APPLE__)
static
inline
void
dav1d_set_thread_name
(
const
char
*
const
name
)
{
pthread_setname_np
(
name
);
}
#elif defined(__DragonFly__) || defined(__FreeBSD__) || defined(__OpenBSD__)
#if defined(__FreeBSD__)
...
...
@@ -151,13 +157,13 @@ static inline void dav1d_set_thread_name(const char* name) {
#endif
#include
<pthread_np.h>
static
inline
void
dav1d_set_thread_name
(
const
char
*
name
)
{
static
inline
void
dav1d_set_thread_name
(
const
char
*
const
name
)
{
pthread_set_name_np
(
pthread_self
(),
name
);
}
#elif defined(__NetBSD__)
static
inline
void
dav1d_set_thread_name
(
const
char
*
name
)
{
static
inline
void
dav1d_set_thread_name
(
const
char
*
const
name
)
{
pthread_setname_np
(
pthread_self
(),
"%s"
,
(
void
*
)
name
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment