]> git.saurik.com Git - apple/xnu.git/blobdiff - bsd/pthread/pthread_workqueue.c
xnu-6153.61.1.tar.gz
[apple/xnu.git] / bsd / pthread / pthread_workqueue.c
index 0e83375cdd27820b0b87d439b4ed417f2c1d56b1..5d6361ccae5bf8fd2f47b73af9ddeef38fd40f50 100644 (file)
@@ -461,7 +461,7 @@ workq_thread_needs_params_change(workq_threadreq_t req, struct uthread *uth)
                return true;
        }
 
-       if ((req_flags & TRP_POLICY) && cur_trp.trp_pol != cur_trp.trp_pol) {
+       if ((req_flags & TRP_POLICY) && req_trp.trp_pol != cur_trp.trp_pol) {
                return true;
        }
 
@@ -1856,7 +1856,6 @@ fixedpri:
                }
        }
 
-
 done:
        if (qos_rv && voucher_rv) {
                /* Both failed, give that a unique error. */
@@ -3127,9 +3126,8 @@ again:
                 */
                wq->wq_creator = uth = workq_pop_idle_thread(wq, UT_WORKQ_OVERCOMMIT,
                    &needs_wakeup);
-               if (workq_thread_needs_priority_change(req, uth)) {
-                       workq_thread_reset_pri(wq, uth, req, /*unpark*/ true);
-               }
+               /* Always reset the priorities on the newly chosen creator */
+               workq_thread_reset_pri(wq, uth, req, /*unpark*/ true);
                workq_turnstile_update_inheritor(wq, uth->uu_thread,
                    TURNSTILE_INHERITOR_THREAD);
                WQ_TRACE_WQ(TRACE_wq_creator_select | DBG_FUNC_NONE,