| 788 | } |
| 789 | |
| 790 | void SetThreadPriority(int nPriority) |
| 791 | { |
| 792 | #ifdef WIN32 |
| 793 | SetThreadPriority(GetCurrentThread(), nPriority); |
| 794 | #else // WIN32 |
| 795 | #ifdef PRIO_THREAD |
| 796 | setpriority(PRIO_THREAD, 0, nPriority); |
| 797 | #else // PRIO_THREAD |
| 798 | setpriority(PRIO_PROCESS, 0, nPriority); |
| 799 | #endif // PRIO_THREAD |
| 800 | #endif // WIN32 |
| 801 | } |
| 802 | |
| 803 | int GetNumCores() |
| 804 | { |