Ticket #7932: 7932-win32_nice.2.patch
File 7932-win32_nice.2.patch, 1.0 KB (added by , 14 years ago) |
---|
-
libs/libmythdb/compat.h
182 182 #ifdef USING_MINGW 183 183 #define lstat stat 184 184 #define bzero(x, y) memset((x), 0, (y)) 185 #define nice(x) ((int)!::SetThreadPriority(\ 186 ::GetCurrentThread(), ((x) < -10) ? \ 187 2 : (((x) < 0) ? \ 188 1 : (((x) > 10) ? \ 189 2 : (((x) > 0) ? 1 : 0))))) 185 #define nice(x) ((int)!::SetPriorityClass(\ 186 ::GetCurrentProcess(), ((x) < -10) ? \ 187 HIGH_PRIORITY_CLASS : (((x) < 0) ? \ 188 ABOVE_NORMAL_PRIORITY_CLASS : (((x) > 10) ? \ 189 IDLE_PRIORITY_CLASS : (((x) > 0) ? \ 190 BELOW_NORMAL_PRIORITY_CLASS : \ 191 NORMAL_PRIORITY_CLASS))))) 190 192 #define PRIO_PROCESS 0 191 193 #define setpriority(x, y, z) ((x) == PRIO_PROCESS && y == 0 ? nice(z) : -1) 192 194 #endif // USING_MINGW