]> git.saurik.com Git - apple/xnu.git/blobdiff - osfmk/kern/thread.c
xnu-3248.50.21.tar.gz
[apple/xnu.git] / osfmk / kern / thread.c
index 64b5ea604379089ca96b7790ed19be8e870459ad..cc8e391b180d9bdde6bf6212e46d16863f7fa65a 100644 (file)
@@ -1728,6 +1728,22 @@ set_vm_privilege(boolean_t privileged)
        return (was_vmpriv);
 }
 
+void
+set_thread_rwlock_boost(void)
+{
+       current_thread()->rwlock_count++;
+}
+
+void
+clear_thread_rwlock_boost(void)
+{
+       thread_t thread = current_thread();
+
+       if ((thread->rwlock_count-- == 1) && (thread->sched_flags & TH_SFLAG_RW_PROMOTED)) {
+
+               lck_rw_clear_promotion(thread);
+       }
+}
 
 /*
  * XXX assuming current thread only, for now...