MCPcopy Create free account
hub / github.com/coreutils/coreutils / queue_pop

Function queue_pop

src/sort.c:3654–3665  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3652/* Pop the top node off the priority QUEUE, lock the node, return it. */
3653
3654static struct merge_node *
3655queue_pop (struct merge_node_queue *queue)
3656{
3657 struct merge_node *node;
3658 pthread_mutex_lock (&queue->mutex);
3659 while (! (node = heap_remove_top (queue->priority_queue)))
3660 pthread_cond_wait (&queue->cond, &queue->mutex);
3661 pthread_mutex_unlock (&queue->mutex);
3662 lock_node (node);
3663 node->queued = false;
3664 return node;
3665}
3666
3667/* Output LINE to TFP, unless -u is specified and the line compares
3668 equal to the previous line. TEMP_OUTPUT is the name of TFP, or

Callers 1

merge_loopFunction · 0.85

Calls 2

heap_remove_topFunction · 0.85
lock_nodeFunction · 0.85

Tested by

no test coverage detected