MCPcopy Create free account
hub / github.com/TASEmulators/fceux / getSchedParam

Method getSchedParam

src/drivers/Qt/ConsoleWindow.cpp:4406–4441  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4404}
4405
4406int 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
4443int consoleWin_t::setSchedParam( int policy, int priority )
4444{

Callers 7

saveValuesMethod · 0.80
emuSchedPrioChangeMethod · 0.80
emuSchedPolicyChangeMethod · 0.80
guiSchedPrioChangeMethod · 0.80
guiSchedPolicyChangeMethod · 0.80
updatePolicyBoxMethod · 0.80
updateSliderValuesMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected