-
Notifications
You must be signed in to change notification settings - Fork 173
Expand file tree
/
Copy pathctxoptions_unix.go
More file actions
56 lines (40 loc) · 1.36 KB
/
Copy pathctxoptions_unix.go
File metadata and controls
56 lines (40 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// +build !windows
package zmq4
/*
#include <zmq.h>
#include "zmq4.h"
*/
import "C"
/*
Sets the scheduling policy for internal context’s thread pool.
This option requires ZeroMQ version 4.1, and is not available on Windows.
Supported values for this option can be found in sched.h file, or at
http://man7.org/linux/man-pages/man2/sched_setscheduler.2.html
This option only applies before creating any sockets on the context.
Default value: -1
Returns ErrorNotImplemented41 with ZeroMQ version < 4.1
Returns ErrorNotImplementedWindows on Windows
*/
func (ctx *Context) SetThreadSchedPolicy(n int) error {
if minor < 1 {
return ErrorNotImplemented41
}
return setOption(ctx, C.ZMQ_THREAD_SCHED_POLICY, n)
}
/*
Sets scheduling priority for internal context’s thread pool.
This option requires ZeroMQ version 4.1, and is not available on Windows.
Supported values for this option depend on chosen scheduling policy.
Details can be found in sched.h file, or at
http://man7.org/linux/man-pages/man2/sched_setscheduler.2.html
This option only applies before creating any sockets on the context.
Default value: -1
Returns ErrorNotImplemented41 with ZeroMQ version < 4.1
Returns ErrorNotImplementedWindows on Windows
*/
func (ctx *Context) SetThreadPriority(n int) error {
if minor < 1 {
return ErrorNotImplemented41
}
return setOption(ctx, C.ZMQ_THREAD_PRIORITY, n)
}