OpenDNSSEC-signer  1.3.4
Data Structures | Defines | Typedefs | Functions
/build/buildd/opendnssec-1.3.4/signer/src/scheduler/fifoq.h File Reference
#include "config.h"
#include "daemon/worker.h"
#include "shared/allocator.h"
#include "shared/locks.h"
#include "shared/status.h"
#include <stdio.h>
#include <time.h>
#include <ldns/ldns.h>
Include dependency graph for fifoq.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  fifoq_struct

Defines

#define FIFOQ_MAX_COUNT   1000
#define FIFOQ_TRIES_COUNT   100

Typedefs

typedef struct fifoq_struct fifoq_type

Functions

fifoq_typefifoq_create (allocator_type *allocator)
void fifoq_wipe (fifoq_type *q)
void * fifoq_pop (fifoq_type *q, worker_type **worker)
ods_status fifoq_push (fifoq_type *q, void *item, worker_type *worker, int *tries)
void fifoq_cleanup (fifoq_type *q)

Define Documentation

#define FIFOQ_MAX_COUNT   1000

FIFO Queue.

Definition at line 55 of file fifoq.h.

Referenced by fifoq_push(), and fifoq_wipe().

#define FIFOQ_TRIES_COUNT   100

Definition at line 56 of file fifoq.h.

Referenced by fifoq_push().


Typedef Documentation

typedef struct fifoq_struct fifoq_type

FIFO Queue.

Definition at line 61 of file fifoq.h.


Function Documentation

void fifoq_cleanup ( fifoq_type q)

Clean up queue.

Parameters:
[in]qqueue to be cleaned up

Clean up queue.

Definition at line 175 of file fifoq.c.

References zonelist_struct::allocator, fifoq_struct::allocator, allocator_deallocate(), lock_basic_destroy, lock_basic_off, ods_log_assert, fifoq_struct::q_lock, and fifoq_struct::q_threshold.

Referenced by engine_cleanup().

Create new FIFO queue.

Parameters:
[in]allocatormemory allocator
Returns:
fifoq_type* created queue

Create new FIFO queue.

Definition at line 50 of file fifoq.c.

References zonelist_struct::allocator, fifoq_struct::allocator, allocator_alloc(), fifoq_wipe(), lock_basic_init, lock_basic_set, ods_log_assert, ods_log_error(), fifoq_struct::q_lock, and fifoq_struct::q_threshold.

void* fifoq_pop ( fifoq_type q,
worker_type **  worker 
)

Pop item from queue.

Parameters:
[in]qqueue
[out]workerworker that owns the item
Returns:
void* popped item

Pop item from queue.

Definition at line 98 of file fifoq.c.

References fifoq_struct::blob, fifoq_struct::count, ods_log_deeebug(), and fifoq_struct::owner.

ods_status fifoq_push ( fifoq_type q,
void *  item,
worker_type worker,
int *  tries 
)

Push item to queue.

Parameters:
[in]qqueue
[in]itemitem
[in]workerowner of item
[in]triesnumber of tries
Returns:
ods_status status

Push item to queue.

Definition at line 127 of file fifoq.c.

References fifoq_struct::blob, fifoq_struct::count, FIFOQ_MAX_COUNT, FIFOQ_TRIES_COUNT, lock_basic_broadcast, ods_log_assert, ods_log_debug(), ods_log_deeebug(), ods_log_error(), ODS_STATUS_ASSERT_ERR, ODS_STATUS_OK, ODS_STATUS_UNCHANGED, fifoq_struct::owner, and fifoq_struct::q_threshold.

Referenced by rrset_queue().

void fifoq_wipe ( fifoq_type q)

Wipe queue.

Parameters:
[in]qqueue to be wiped
[out]workerworker that owns the item

Wipe queue.

Definition at line 80 of file fifoq.c.

References fifoq_struct::blob, fifoq_struct::count, FIFOQ_MAX_COUNT, and fifoq_struct::owner.

Referenced by fifoq_create().