MCPcopy Create free account
hub / github.com/F-Stack/f-stack / umtxq_insert_queue

Function umtxq_insert_queue

freebsd/kern/kern_umtx.c:599–631  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

597}
598
599static inline void
600umtxq_insert_queue(struct umtx_q *uq, int q)
601{
602 struct umtxq_queue *uh;
603 struct umtxq_chain *uc;
604
605 uc = umtxq_getchain(&uq->uq_key);
606 UMTXQ_LOCKED_ASSERT(uc);
607 KASSERT((uq->uq_flags & UQF_UMTXQ) == 0, ("umtx_q is already on queue"));
608 uh = umtxq_queue_lookup(&uq->uq_key, q);
609 if (uh != NULL) {
610 LIST_INSERT_HEAD(&uc->uc_spare_queue, uq->uq_spare_queue, link);
611 } else {
612 uh = uq->uq_spare_queue;
613 uh->key = uq->uq_key;
614 LIST_INSERT_HEAD(&uc->uc_queue[q], uh, link);
615#ifdef UMTX_PROFILING
616 uc->length++;
617 if (uc->length > uc->max_length) {
618 uc->max_length = uc->length;
619 if (uc->max_length > max_length)
620 max_length = uc->max_length;
621 }
622#endif
623 }
624 uq->uq_spare_queue = NULL;
625
626 TAILQ_INSERT_TAIL(&uh->head, uq, uq_link);
627 uh->length++;
628 uq->uq_flags |= UQF_UMTXQ;
629 uq->uq_cur_queue = uh;
630 return;
631}
632
633static inline void
634umtxq_remove_queue(struct umtx_q *uq, int q)

Callers 1

do_rw_wrlockFunction · 0.85

Calls 2

umtxq_getchainFunction · 0.85
umtxq_queue_lookupFunction · 0.85

Tested by

no test coverage detected