mirror of
https://github.com/zeromq/libzmq.git
synced 2024-12-12 18:40:27 +01:00
Fix NetBSD thread scheduling problem.
Defining thread priority for SCHED_OTHER is implementation defined. Some platforms like NetBSD cannot reassign it as they are dynamic. <http://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_getschedparam.html> Credit goes to <kamil@netbsd.org> and <riastradh@netbsd.org> for finding this solution.
This commit is contained in:
parent
7a563ebb2c
commit
37a4a4075e
@ -138,6 +138,10 @@ void zmq::thread_t::setSchedulingParameters(int priority_, int schedulingPolicy_
|
||||
policy = schedulingPolicy_;
|
||||
}
|
||||
|
||||
#ifdef __NetBSD__
|
||||
if(policy == SCHED_OTHER) param.sched_priority = -1;
|
||||
#endif
|
||||
|
||||
rc = pthread_setschedparam(descriptor, policy, ¶m);
|
||||
posix_assert (rc);
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user