pazpar2
1.14.1
|
#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 |
|
static |
Definition at line 262 of file eventl.c.
References iochan_man_s::channel_list, iochan::destroyed, EVENT_EXCEPT, EVENT_INPUT, EVENT_OUTPUT, EVENT_TIMEOUT, iochan::fd, iochan_man_s::fds, iochan::flags, iochan_destroy_real(), iochan_man_s::iochan_mutex, iochan::last_event, iochan_man_s::log_level, iochan::max_idle, iochan::name, iochan::next, iochan::poll_offset, run_fun(), iochan_man_s::sel_fd, iochan_man_s::sel_thread, sel_thread_result(), iochan_man_s::size_fds, iochan::this_event, and iochan::thread_users.
Referenced by iochan_man_events().
int iochan_add | ( | iochan_man_t | man, |
IOCHAN | chan, | ||
int | slack | ||
) |
Definition at line 173 of file eventl.c.
References iochan_man_s::channel_list, iochan::fd, iochan_man_s::iochan_mutex, iochan_man_s::limit_fd, iochan_man_s::log_level, iochan::man, and iochan::next.
Referenced by connection_connect(), http_accept(), http_init(), http_proxy(), http_session_create(), and test_for_real_work().
IOCHAN iochan_create | ( | int | fd, |
IOC_CALLBACK | cb, | ||
int | flags, | ||
const char * | name | ||
) |
Definition at line 209 of file eventl.c.
References iochan::destroyed, iochan::fd, iochan::flags, iochan::fun, iochan_use(), iochan::last_event, iochan::man, iochan::max_idle, iochan::name, name, iochan::next, and iochan::thread_users.
Referenced by connection_connect(), http_accept(), http_init(), http_proxy(), http_session_create(), and test_for_real_work().
void iochan_destroy | ( | IOCHAN | chan | ) |
Definition at line 201 of file eventl.c.
References iochan::destroyed, iochan_destroy_real(), and iochan::man.
Referenced by connection_connect(), connection_destroy(), http_channel_destroy(), http_init(), http_proxy(), http_session_destroy(), http_sessions_destroy(), iochan_handler(), and proxy_io().
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 | ||
) |
Definition at line 113 of file eventl.c.
References iochan_man_s::channel_list, iochan_man_s::fds, iochan_man_s::iochan_mutex, iochan_man_s::limit_fd, iochan_man_s::log_level, iochan_man_s::no_threads, iochan_man_s::sel_fd, iochan_man_s::sel_thread, and iochan_man_s::size_fds.
Referenced by config_start_listeners(), and test_for_real_work().
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 | ) |
Definition at line 433 of file eventl.c.
References iochan_man_s::channel_list, event_loop(), iochan_man_s::log_level, iochan_man_s::no_threads, iochan_man_s::sel_fd, iochan_man_s::sel_thread, sel_thread_create(), and work_handler().
Referenced by config_process_events(), and test_for_real_work().
|
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 |
Definition at line 248 of file eventl.c.
References iochan_man_s::log_level, iochan::name, iochan_man_s::sel_thread, sel_thread_add(), iochan::this_event, iochan::thread_users, and work_handler().
Referenced by event_loop().
|
static |
Definition at line 228 of file eventl.c.
References iochan::destroyed, EVENT_EXCEPT, EVENT_INPUT, EVENT_OUTPUT, EVENT_TIMEOUT, iochan::fun, iochan_man_s::log_level, iochan::man, iochan::name, and iochan::this_event.
Referenced by iochan_man_events(), run_fun(), and sel_thread_create().
|
static |
Definition at line 60 of file eventl.c.
Referenced by iochan_use(), and iochans_count_total().
|
static |
Definition at line 61 of file eventl.c.
Referenced by iochan_use().
|
static |
Definition at line 62 of file eventl.c.
Referenced by iochan_use(), and iochans_count_total().