Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix POSIX C++11 build
I broke this in 46fd114.
  • Loading branch information
ShadowNinja committed Apr 30, 2016
1 parent ae75073 commit a53357d
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/threading/thread.cpp
Expand Up @@ -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_thread_handle, SIGKILL);
pthread_kill(getThreadHandle(), SIGKILL);
# else
pthread_cancel(m_thread_handle);
pthread_cancel(getThreadHandle());
# endif
wait();
#endif
Expand Down Expand Up @@ -361,7 +361,7 @@ bool Thread::bindToProcessor(unsigned int proc_number)

#elif defined(_WIN32)

return SetThreadAffinityMask(m_thread_handle, 1 << proc_number);
return SetThreadAffinityMask(getThreadHandle(), 1 << proc_number);

#elif __FreeBSD_version >= 702106 || defined(__linux) || defined(linux)

Expand All @@ -370,7 +370,7 @@ bool Thread::bindToProcessor(unsigned int proc_number)
CPU_ZERO(&cpuset);
CPU_SET(proc_number, &cpuset);

return pthread_setaffinity_np(m_thread_handle, sizeof(cpuset), &cpuset) == 0;
return pthread_setaffinity_np(getThreadHandle(), sizeof(cpuset), &cpuset) == 0;

#elif defined(__sun) || defined(sun)

Expand All @@ -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_thread_handle) == 0;
&answer, proc_number, getThreadHandle()) == 0;

#elif defined(__APPLE__)

struct thread_affinity_policy tapol;

thread_port_t threadport = pthread_mach_thread_np(m_thread_handle);
thread_port_t threadport = pthread_mach_thread_np(getThreadHandle());
tapol.affinity_tag = proc_number + 1;
return thread_policy_set(threadport, THREAD_AFFINITY_POLICY,
(thread_policy_t)&tapol,
Expand All @@ -409,21 +409,21 @@ bool Thread::setPriority(int prio)
{
#if defined(_WIN32)

return SetThreadPriority(m_thread_handle, prio);
return SetThreadPriority(getThreadHandle(), prio);

#else

struct sched_param sparam;
int policy;

if (pthread_getschedparam(m_thread_handle, &policy, &sparam) != 0)
if (pthread_getschedparam(getThreadHandle(), &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_thread_handle, policy, &sparam) == 0;
return pthread_setschedparam(getThreadHandle(), policy, &sparam) == 0;

#endif
}
Expand Down

0 comments on commit a53357d

Please sign in to comment.