]> git.ipfire.org Git - thirdparty/squid.git/blob - src/CpuAffinitySet.h
Removed CVS $ markers
[thirdparty/squid.git] / src / CpuAffinitySet.h
1 /*
2 */
3
4 #ifndef SQUID_CPU_AFFINITY_SET_H
5 #define SQUID_CPU_AFFINITY_SET_H
6
7 #include "compat/cpu.h"
8
9 /// cpu affinity management for a single process
10 class CpuAffinitySet
11 {
12 public:
13 CpuAffinitySet();
14
15 /// set CPU affinity for this process
16 void apply();
17
18 /// undo CPU affinity changes for this process
19 void undo();
20
21 /// whether apply() was called and was not undone
22 bool applied() const;
23
24 /// set CPU affinity mask
25 void set(const cpu_set_t &aCpuSet);
26
27 private:
28 cpu_set_t theCpuSet; ///< configured CPU affinity for this process
29 cpu_set_t theOrigCpuSet; ///< CPU affinity for this process before apply()
30 };
31
32 #endif // SQUID_CPU_AFFINITY_SET_H