mirror of
				https://github.com/zeromq/libzmq.git
				synced 2025-10-27 11:06:52 +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:
		| @@ -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 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Yuval Langer
					Yuval Langer