mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-08-05 21:37:15 +02:00
36 lines
1.1 KiB
Diff
36 lines
1.1 KiB
Diff
--- a/src/Utils/Process.cpp
|
|
+++ b/src/Utils/Process.cpp
|
|
@@ -18,6 +18,7 @@
|
|
#include <sys/procctl.h>
|
|
#endif
|
|
|
|
+#include <pthread.h>
|
|
#include <stdlib.h>
|
|
#include <dirent.h>
|
|
#include <unistd.h>
|
|
@@ -472,7 +473,7 @@
|
|
struct sched_param newSched{};
|
|
sched_getparam( 0, &newSched );
|
|
newSched.sched_priority = sched_get_priority_min( SCHED_RR );
|
|
- if ( sched_setscheduler( 0, SCHED_RR, &newSched ) )
|
|
+ if ( pthread_setschedparam( pthread_self(), SCHED_RR, &newSched ) )
|
|
{
|
|
s_ProcessLog.errorf_errno( "Failed to set realtime scheduling." );
|
|
return false;
|
|
@@ -491,7 +492,7 @@
|
|
if ( !g_oOldSchedulerInfo )
|
|
return;
|
|
|
|
- if ( sched_setscheduler( 0, g_oOldSchedulerInfo->nPolicy, &g_oOldSchedulerInfo->SchedParam ) )
|
|
+ if ( pthread_setschedparam( pthread_self(), g_oOldSchedulerInfo->nPolicy, &g_oOldSchedulerInfo->SchedParam ) )
|
|
{
|
|
s_ProcessLog.errorf_errno( "Failed to restore from realtime scheduling." );
|
|
return;
|
|
@@ -506,4 +507,4 @@
|
|
return __progname;
|
|
}
|
|
|
|
-}
|
|
\ No newline at end of file
|
|
+}
|