Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
illuna-minetest
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Illuna-Minetest
illuna-minetest
Commits
a53357d2
Commit
a53357d2
authored
8 years ago
by
ShadowNinja
Browse files
Options
Downloads
Patches
Plain Diff
Fix POSIX C++11 build
I broke this in
46fd114e
.
parent
ae750739
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/threading/thread.cpp
+9
-9
9 additions, 9 deletions
src/threading/thread.cpp
with
9 additions
and
9 deletions
src/threading/thread.cpp
+
9
−
9
View file @
a53357d2
...
...
@@ -205,9 +205,9 @@ bool Thread::kill()
// We need to pthread_kill instead on Android since NDKv5's pthread
// implementation is incomplete.
# ifdef __ANDROID__
pthread_kill
(
m_t
hread
_h
andle
,
SIGKILL
);
pthread_kill
(
getT
hread
H
andle
()
,
SIGKILL
);
# else
pthread_cancel
(
m_t
hread
_h
andle
);
pthread_cancel
(
getT
hread
H
andle
()
);
# endif
wait
();
#endif
...
...
@@ -361,7 +361,7 @@ bool Thread::bindToProcessor(unsigned int proc_number)
#elif defined(_WIN32)
return
SetThreadAffinityMask
(
m_t
hread
_h
andle
,
1
<<
proc_number
);
return
SetThreadAffinityMask
(
getT
hread
H
andle
()
,
1
<<
proc_number
);
#elif __FreeBSD_version >= 702106 || defined(__linux) || defined(linux)
...
...
@@ -370,7 +370,7 @@ bool Thread::bindToProcessor(unsigned int proc_number)
CPU_ZERO
(
&
cpuset
);
CPU_SET
(
proc_number
,
&
cpuset
);
return
pthread_setaffinity_np
(
m_t
hread
_h
andle
,
sizeof
(
cpuset
),
&
cpuset
)
==
0
;
return
pthread_setaffinity_np
(
getT
hread
H
andle
()
,
sizeof
(
cpuset
),
&
cpuset
)
==
0
;
#elif defined(__sun) || defined(sun)
...
...
@@ -385,13 +385,13 @@ bool Thread::bindToProcessor(unsigned int proc_number)
pthread_spu_t
answer
;
return
pthread_processor_bind_np
(
PTHREAD_BIND_ADVISORY_NP
,
&
answer
,
proc_number
,
m_t
hread
_h
andle
)
==
0
;
&
answer
,
proc_number
,
getT
hread
H
andle
()
)
==
0
;
#elif defined(__APPLE__)
struct
thread_affinity_policy
tapol
;
thread_port_t
threadport
=
pthread_mach_thread_np
(
m_t
hread
_h
andle
);
thread_port_t
threadport
=
pthread_mach_thread_np
(
getT
hread
H
andle
()
);
tapol
.
affinity_tag
=
proc_number
+
1
;
return
thread_policy_set
(
threadport
,
THREAD_AFFINITY_POLICY
,
(
thread_policy_t
)
&
tapol
,
...
...
@@ -409,21 +409,21 @@ bool Thread::setPriority(int prio)
{
#if defined(_WIN32)
return
SetThreadPriority
(
m_t
hread
_h
andle
,
prio
);
return
SetThreadPriority
(
getT
hread
H
andle
()
,
prio
);
#else
struct
sched_param
sparam
;
int
policy
;
if
(
pthread_getschedparam
(
m_t
hread
_h
andle
,
&
policy
,
&
sparam
)
!=
0
)
if
(
pthread_getschedparam
(
getT
hread
H
andle
()
,
&
policy
,
&
sparam
)
!=
0
)
return
false
;
int
min
=
sched_get_priority_min
(
policy
);
int
max
=
sched_get_priority_max
(
policy
);
sparam
.
sched_priority
=
min
+
prio
*
(
max
-
min
)
/
THREAD_PRIORITY_HIGHEST
;
return
pthread_setschedparam
(
m_t
hread
_h
andle
,
policy
,
&
sparam
)
==
0
;
return
pthread_setschedparam
(
getT
hread
H
andle
()
,
policy
,
&
sparam
)
==
0
;
#endif
}
...
...
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