pazpar2  1.14.1
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

◆ event_loop()

static int event_loop ( iochan_man_t  man,
IOCHAN iochans 
)
static

◆ iochan_add()

int iochan_add ( iochan_man_t  man,
IOCHAN  chan,
int  slack 
)

◆ iochan_create()

IOCHAN iochan_create ( int  fd,
IOC_CALLBACK  cb,
int  flags,
const char *  name 
)

◆ iochan_destroy()

void iochan_destroy ( IOCHAN  chan)

◆ iochan_destroy_real()

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_create()

iochan_man_t iochan_man_create ( int  no_threads,
int  max_sockets 
)

◆ iochan_man_destroy()

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().

◆ iochan_man_events()

void iochan_man_events ( iochan_man_t  man)

◆ iochan_use()

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().

◆ iochans_count()

int iochans_count ( void  )

Definition at line 80 of file eventl.c.

References iochan_use().

◆ iochans_count_total()

int iochans_count_total ( void  )

Definition at line 85 of file eventl.c.

References g_mutex, and no_iochans_total.

◆ run_fun()

static void run_fun ( iochan_man_t  man,
IOCHAN  p 
)
static

◆ work_handler()

static void work_handler ( void *  work_data)
static

Variable Documentation

◆ g_mutex

YAZ_MUTEX g_mutex = 0
static

Definition at line 60 of file eventl.c.

Referenced by iochan_use(), and iochans_count_total().

◆ no_iochans

int no_iochans = 0
static

Definition at line 61 of file eventl.c.

Referenced by iochan_use().

◆ no_iochans_total

int no_iochans_total = 0
static

Definition at line 62 of file eventl.c.

Referenced by iochan_use(), and iochans_count_total().