| 4404 | } |
| 4405 | |
| 4406 | int consoleWin_t::getSchedParam( int &policy, int &priority ) |
| 4407 | { |
| 4408 | int ret = 0; |
| 4409 | |
| 4410 | #if defined(__linux__) || defined(__unix__) && !defined(__OpenBSD__) |
| 4411 | struct sched_param p; |
| 4412 | |
| 4413 | policy = sched_getscheduler( getpid() ); |
| 4414 | |
| 4415 | if ( sched_getparam( getpid(), &p ) ) |
| 4416 | { |
| 4417 | perror("GUI thread sched_getparam error: "); |
| 4418 | ret = -1; |
| 4419 | priority = 0; |
| 4420 | } |
| 4421 | else |
| 4422 | { |
| 4423 | priority = p.sched_priority; |
| 4424 | } |
| 4425 | |
| 4426 | #elif defined(__APPLE__) |
| 4427 | struct sched_param p; |
| 4428 | |
| 4429 | if ( pthread_getschedparam( pthread_self(), &policy, &p ) ) |
| 4430 | { |
| 4431 | perror("GUI thread pthread_getschedparam error: "); |
| 4432 | ret = -1; |
| 4433 | priority = 0; |
| 4434 | } |
| 4435 | else |
| 4436 | { |
| 4437 | priority = p.sched_priority; |
| 4438 | } |
| 4439 | #endif |
| 4440 | return ret; |
| 4441 | } |
| 4442 | |
| 4443 | int consoleWin_t::setSchedParam( int policy, int priority ) |
| 4444 | { |
no outgoing calls
no test coverage detected