pazpar2  1.13.0
Data Structures | Functions | Variables
eventl.c File Reference
#include <math.h>
#include <stdio.h>
#include <assert.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <yaz/yconfig.h>
#include <yaz/log.h>
#include <yaz/comstack.h>
#include <yaz/xmalloc.h>
#include <yaz/mutex.h>
#include <yaz/poll.h>
#include "eventl.h"
#include "sel_thread.h"

Go to the source code of this file.

Data Structures

struct  iochan_man_s
 

Functions

static int iochan_use (int delta)
 
int iochans_count (void)
 
int iochans_count_total (void)
 
iochan_man_t iochan_man_create (int no_threads, int max_sockets)
 
IOCHAN iochan_destroy_real (IOCHAN chan)
 
void iochan_man_destroy (iochan_man_t *mp)
 
int iochan_add (iochan_man_t man, IOCHAN chan, int slack)
 
void iochan_destroy (IOCHAN chan)
 
IOCHAN iochan_create (int fd, IOC_CALLBACK cb, int flags, const char *name)
 
static void work_handler (void *work_data)
 
static void run_fun (iochan_man_t man, IOCHAN p)
 
static int event_loop (iochan_man_t man, IOCHAN *iochans)
 
void iochan_man_events (iochan_man_t man)
 

Variables

static YAZ_MUTEX g_mutex = 0
 
static int no_iochans = 0
 
static int no_iochans_total = 0
 

Function Documentation

static int event_loop ( iochan_man_t  man,
IOCHAN iochans 
)
static
int iochan_add ( iochan_man_t  man,
IOCHAN  chan,
int  slack 
)
IOCHAN iochan_create ( int  fd,
IOC_CALLBACK  cb,
int  flags,
const char *  name 
)
void iochan_destroy ( IOCHAN  chan)
IOCHAN iochan_destroy_real ( IOCHAN  chan)

Definition at line 142 of file eventl.c.

References iochan_use(), iochan::name, and iochan::next.

Referenced by event_loop(), iochan_destroy(), and iochan_man_destroy().

iochan_man_t iochan_man_create ( int  no_threads,
int  max_sockets 
)
void iochan_man_destroy ( iochan_man_t mp)

Definition at line 152 of file eventl.c.

References iochan_destroy_real(), and sel_thread_destroy().

Referenced by config_destroy(), and test_for_real_work().

void iochan_man_events ( iochan_man_t  man)
static int iochan_use ( int  delta)
static

Definition at line 64 of file eventl.c.

References g_mutex, no_iochans, and no_iochans_total.

Referenced by iochan_create(), iochan_destroy_real(), and iochans_count().

int iochans_count ( void  )

Definition at line 80 of file eventl.c.

References iochan_use().

int iochans_count_total ( void  )

Definition at line 85 of file eventl.c.

References g_mutex, and no_iochans_total.

static void run_fun ( iochan_man_t  man,
IOCHAN  p 
)
static
static void work_handler ( void *  work_data)
static

Variable Documentation

YAZ_MUTEX g_mutex = 0
static

Definition at line 60 of file eventl.c.

Referenced by iochan_use(), and iochans_count_total().

int no_iochans = 0
static

Definition at line 61 of file eventl.c.

Referenced by iochan_use().

int no_iochans_total = 0
static

Definition at line 62 of file eventl.c.

Referenced by iochan_use(), and iochans_count_total().