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

Function queue_init

src/sort.c:3628–3637  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3626 NTHREADS threads. */
3627
3628static void
3629queue_init (struct merge_node_queue *queue, size_t nthreads)
3630{
3631 /* Though it's highly unlikely all nodes are in the heap at the same
3632 time, the heap should accommodate all of them. Counting a null
3633 dummy head for the heap, reserve 2 * NTHREADS nodes. */
3634 queue->priority_queue = heap_alloc (compare_nodes, 2 * nthreads);
3635 pthread_mutex_init (&queue->mutex, NULL);
3636 pthread_cond_init (&queue->cond, NULL);
3637}
3638
3639/* Insert NODE into QUEUE. The caller either holds a lock on NODE, or
3640 does not need to lock NODE. */

Callers 1

sortFunction · 0.85

Calls 1

heap_allocFunction · 0.85

Tested by

no test coverage detected