sched_affinity_win32_wrapper.h 736 Bytes
Newer Older
qon's avatar
qon committed
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
#ifndef SCHED_AFFINITY_WIN32_WRAPPER_H
#define SCHED_AFFINITY_WIN32_WRAPPER_H

typedef __int64 cpu_set_t;
typedef HANDLE pid_t;

static inline int CPU_ISSET(__int64 cpu, cpu_set_t *set)
{
	return((*set & ((__int64) 1 << cpu)) ? 1 : 0);
}

static inline int sched_setaffinity(pid_t pid, unsigned int cpusetsize, cpu_set_t *mask)
{
	return(0);
}
static inline int sched_getaffinity(pid_t pid, unsigned int cpusetsize, cpu_set_t *mask)
{
	return(0);
}
static inline void CPU_CLR(__int64 cpu, cpu_set_t *set)
{
	*set &= (~((__int64) 1 << cpu));
}

static inline void CPU_SET(__int64 cpu, cpu_set_t *set)
{
	*set |= ((__int64) 1 << cpu);
}

static inline void CPU_ZERO(cpu_set_t *set)
{
	*set = 0;
}

#endif