Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8255ba7b authored by Glenn Kasten's avatar Glenn Kasten
Browse files

sched_getscheduler may include SCHED_RESET_ON_FORK

The SCHED_RESET_ON_FORK flag is visible in the policy value returned by sched_getscheduler()

Bug: 31020591
Change-Id: I5243fadce2a5f629fa2dc61888d8aa9aff32d9ca
parent 2180a832
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -924,7 +924,7 @@ nsecs_t AudioRecord::processAudioBuffer()
        int32_t tryCounter = kMaxTries;
        uint32_t pollUs = 10000;
        do {
            int policy = sched_getscheduler(0);
            int policy = sched_getscheduler(0) & ~SCHED_RESET_ON_FORK;
            if (policy == SCHED_FIFO || policy == SCHED_RR) {
                break;
            }
+1 −1
Original line number Diff line number Diff line
@@ -1777,7 +1777,7 @@ nsecs_t AudioTrack::processAudioBuffer()
        int32_t tryCounter = kMaxTries;
        uint32_t pollUs = 10000;
        do {
            int policy = sched_getscheduler(0);
            int policy = sched_getscheduler(0) & ~SCHED_RESET_ON_FORK;
            if (policy == SCHED_FIFO || policy == SCHED_RR) {
                break;
            }
+1 −1
Original line number Diff line number Diff line
@@ -167,7 +167,7 @@ bool FastThread::threadLoop()
                if (old <= 0) {
                    syscall(__NR_futex, coldFutexAddr, FUTEX_WAIT_PRIVATE, old - 1, NULL);
                }
                int policy = sched_getscheduler(0);
                int policy = sched_getscheduler(0) & ~SCHED_RESET_ON_FORK;
                if (!(policy == SCHED_FIFO || policy == SCHED_RR)) {
                    ALOGE("did not receive expected priority boost");
                }