From: Ondřej Surý Date: Wed, 3 Jul 2024 09:51:09 +0000 (+0200) Subject: Clarify that cds_wfcq_dequeue_blocking() doesn't block if empty X-Git-Tag: alessio/regression/026024a6ae~5^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=912eaf6cb9f153cc8551e1ad0d8aa7b7a725fc84;p=thirdparty%2Fbind9.git Clarify that cds_wfcq_dequeue_blocking() doesn't block if empty --- diff --git a/lib/isc/quota.c b/lib/isc/quota.c index ad58f338106..a4ddebc6125 100644 --- a/lib/isc/quota.c +++ b/lib/isc/quota.c @@ -70,6 +70,10 @@ isc_quota_release(isc_quota_t *quota) { * We are using the cds_wfcq_dequeue_blocking() variant here that * has an internal mutex because we need synchronization on * multiple dequeues running from different threads. + * + * NOTE: cds_wfcq_dequeue_blocking() checks whether the queue is free + * with cds_wfcq_empty() before acquiring the internal lock, so if + * there's nothing queued, the call should be very lightweight. */ struct cds_wfcq_node *node = cds_wfcq_dequeue_blocking("a->jobs.head, "a->jobs.tail);