Lines Matching refs:ulwp
510 ulwp_t *ulwp; in QVERIFY() local
531 for (prev = NULL, ulwp = qrp->qr_head; ulwp != NULL; in QVERIFY()
532 prev = ulwp, ulwp = ulwp->ul_link) { in QVERIFY()
534 if (ulwp->ul_writer) in QVERIFY()
536 ASSERT(ulwp->ul_qtype == qtype); in QVERIFY()
537 ASSERT(ulwp->ul_wchan != NULL); in QVERIFY()
538 ASSERT(ulwp->ul_sleepq == qp); in QVERIFY()
539 wchan = ulwp->ul_wchan; in QVERIFY()
610 #define CMP_PRIO(ulwp) ((real_priority(ulwp) << 1) + (ulwp)->ul_writer) argument
613 enqueue(queue_head_t *qp, ulwp_t *ulwp, int force_fifo) in enqueue() argument
618 int pri = CMP_PRIO(ulwp); in enqueue()
621 ASSERT(ulwp->ul_sleepq != qp); in enqueue()
625 qrp = &ulwp->ul_queue_root; in enqueue()
695 if ((ulwp->ul_link = *ulwpp) == NULL) in enqueue()
696 qrp->qr_tail = ulwp; in enqueue()
697 *ulwpp = ulwp; in enqueue()
699 ulwp->ul_sleepq = qp; in enqueue()
700 ulwp->ul_wchan = qp->qh_wchan; in enqueue()
701 ulwp->ul_qtype = qp->qh_type; in enqueue()
702 if ((ulwp->ul_schedctl != NULL && in enqueue()
703 ulwp->ul_schedctl->sc_cid == ulwp->ul_rtclassid) | in enqueue()
704 ulwp->ul_pilocks) { in enqueue()
705 ulwp->ul_rtqueued = 1; in enqueue()
719 ulwp_t *ulwp; in queue_slot_runnable() local
726 (ulwp = *ulwpp) != NULL; in queue_slot_runnable()
727 prev = ulwp, ulwpp = &ulwp->ul_link) { in queue_slot_runnable()
728 if (ulwp->ul_stop) /* skip suspended threads */ in queue_slot_runnable()
730 tpri = rt? CMP_PRIO(ulwp) : 0; in queue_slot_runnable()
750 ulwp_t *ulwp = *ulwpp; in queue_slot_rt() local
752 int priority = CMP_PRIO(ulwp); in queue_slot_rt()
756 for (prev = ulwp, ulwpp = &ulwp->ul_link; in queue_slot_rt()
757 (ulwp = *ulwpp) != NULL; in queue_slot_rt()
758 prev = ulwp, ulwpp = &ulwp->ul_link) { in queue_slot_rt()
759 tpri = CMP_PRIO(ulwp); in queue_slot_rt()
766 ulwp = *foundpp; in queue_slot_rt()
772 if (ulwp->ul_stop && in queue_slot_rt()
775 ulwp = *foundpp; in queue_slot_rt()
777 ulwp->ul_rt = 1; in queue_slot_rt()
786 ulwp_t *ulwp; in queue_slot() local
791 if ((qrp = qp->qh_root) == NULL || (ulwp = qrp->qr_head) == NULL) { in queue_slot()
797 if (ulwp->ul_link == NULL) { /* only one lwp on the queue */ in queue_slot()
799 ulwp->ul_rt = rt; in queue_slot()
810 if (ulwp->ul_stop && in queue_slot()
812 ulwp = *ulwpp; in queue_slot()
813 ulwp->ul_rt = 0; in queue_slot()
819 ulwp->ul_rt = 0; in queue_slot()
831 ulwp_t *ulwp = *ulwpp; in queue_unlink() local
835 ASSERT(qp->qh_wchan != NULL && ulwp->ul_wchan == qp->qh_wchan); in queue_unlink()
839 if (ulwp->ul_rtqueued) { in queue_unlink()
840 ulwp->ul_rtqueued = 0; in queue_unlink()
843 next = ulwp->ul_link; in queue_unlink()
845 ulwp->ul_link = NULL; in queue_unlink()
846 if (qrp->qr_tail == ulwp) in queue_unlink()
848 if (qrp == &ulwp->ul_queue_root) { in queue_unlink()
887 ulwp_t *ulwp; in dequeue() local
892 ulwp = *ulwpp; in dequeue()
894 ulwp->ul_sleepq = NULL; in dequeue()
895 ulwp->ul_wchan = NULL; in dequeue()
896 return (ulwp); in dequeue()
920 ulwp_t *ulwp; in dequeue_self() local
929 (ulwp = *ulwpp) != NULL; in dequeue_self()
930 prev = ulwp, ulwpp = &ulwp->ul_link) { in dequeue_self()
931 if (ulwp == self) { in dequeue_self()
1252 ulwp_t *ulwp; in mutex_trylock_adaptive() local
1333 if ((ulwp = (ulwp_t *)(uintptr_t)*ownerp) != NULL && in mutex_trylock_adaptive()
1334 ((scp = ulwp->ul_schedctl) == NULL || in mutex_trylock_adaptive()
1404 ulwp_t *ulwp; in mutex_queuelock_adaptive() local
1421 if ((ulwp = (ulwp_t *)(uintptr_t)*ownerp) != NULL && in mutex_queuelock_adaptive()
1422 ((scp = ulwp->ul_schedctl) == NULL || in mutex_queuelock_adaptive()
1621 ulwp_t *ulwp; in mutex_wakeup() local
1629 if ((ulwp = dequeue(qp, &more)) != NULL) { in mutex_wakeup()
1630 lwpid = ulwp->ul_lwpid; in mutex_wakeup()
1647 ulwp_t *ulwp; in mutex_wakeup_all() local
1670 (ulwp = qrp->qr_head) == NULL) in mutex_wakeup_all()
1672 ASSERT(ulwp->ul_wchan == mp); in mutex_wakeup_all()
1674 ulwp->ul_sleepq = NULL; in mutex_wakeup_all()
1675 ulwp->ul_wchan = NULL; in mutex_wakeup_all()
1678 lwpid[nlwpid++] = ulwp->ul_lwpid; in mutex_wakeup_all()
3135 heldlock_free(ulwp_t *ulwp) in heldlock_free() argument
3139 if ((nlocks = ulwp->ul_heldlockcnt) != 0) in heldlock_free()
3140 lfree(ulwp->ul_heldlocks.array, nlocks * sizeof (mutex_t *)); in heldlock_free()
3141 ulwp->ul_heldlockcnt = 0; in heldlock_free()
3142 ulwp->ul_heldlocks.array = NULL; in heldlock_free()
3820 ulwp_t *ulwp; in cond_signal() local
3846 ulwp = *ulwpp; in cond_signal()
3854 ulwp->ul_signalled = 1; in cond_signal()
3863 mp = ulwp->ul_cvmutex; /* the mutex it will acquire */ in cond_signal()
3864 ulwp->ul_cvmutex = NULL; in cond_signal()
3867 if (ulwp->ul_cv_wake || !MUTEX_OWNED(mp, self)) { in cond_signal()
3869 lwpid = ulwp->ul_lwpid; in cond_signal()
3871 ulwp->ul_sleepq = NULL; in cond_signal()
3872 ulwp->ul_wchan = NULL; in cond_signal()
3879 enqueue(mqp, ulwp, 0); in cond_signal()
3950 ulwp_t *ulwp; in cond_broadcast() local
3988 (ulwp = qrp->qr_head) == NULL) in cond_broadcast()
3990 ASSERT(ulwp->ul_wchan == cvp); in cond_broadcast()
3992 mp = ulwp->ul_cvmutex; /* its mutex */ in cond_broadcast()
3993 ulwp->ul_cvmutex = NULL; in cond_broadcast()
3995 if (ulwp->ul_cv_wake || !MUTEX_OWNED(mp, self)) { in cond_broadcast()
3997 ulwp->ul_sleepq = NULL; in cond_broadcast()
3998 ulwp->ul_wchan = NULL; in cond_broadcast()
4001 lwpid[nlwpid++] = ulwp->ul_lwpid; in cond_broadcast()
4010 enqueue(mqp, ulwp, 0); in cond_broadcast()
4061 record_spin_locks(ulwp_t *ulwp) in record_spin_locks() argument
4063 spin_lock_spin += ulwp->ul_spin_lock_spin; in record_spin_locks()
4064 spin_lock_spin2 += ulwp->ul_spin_lock_spin2; in record_spin_locks()
4065 spin_lock_sleep += ulwp->ul_spin_lock_sleep; in record_spin_locks()
4066 spin_lock_wakeup += ulwp->ul_spin_lock_wakeup; in record_spin_locks()
4067 ulwp->ul_spin_lock_spin = 0; in record_spin_locks()
4068 ulwp->ul_spin_lock_spin2 = 0; in record_spin_locks()
4069 ulwp->ul_spin_lock_sleep = 0; in record_spin_locks()
4070 ulwp->ul_spin_lock_wakeup = 0; in record_spin_locks()