libonion
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
poller.c File Reference
#include <errno.h>
#include <sys/epoll.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
#include <time.h>
#include <unistd.h>
#include <sys/timerfd.h>
#include <fcntl.h>
#include <assert.h>
#include "log.h"
#include "types.h"
#include "poller.h"
#include "low.h"
#include <sys/resource.h>
#include <sys/socket.h>
#include <sys/eventfd.h>

Data Structures

struct  onion_poller_t
 Manages the polling on a set of file descriptors. More...
struct  onion_poller_slot_t
 Data about a poller element: timeout, function to call shutdown function.

Macros

#define pthread_mutex_init(...)
#define pthread_mutex_lock(...)
#define pthread_mutex_trylock(...)   (0)
#define pthread_mutex_unlock(...)
#define EFD_CLOEXEC   0

Functions

void onion_poller_slot_set_type (onion_poller_slot *el, onion_poller_slot_type_e type)
 Sets the polling type: read/write/other. O_POLL_READ | O_POLL_WRITE | O_POLL_OTHER.
onion_poller_slotonion_poller_get (onion_poller *poller, int fd)
 Gets the poller slotThis might be used for long polling, removing the default deleter.
void onion_poller_set_queue_size_per_thread (onion_poller *poller, size_t count)
 Sets the max events per thread queue size.This fine tune allows to change the queue of events per thread.

Macro Definition Documentation

#define EFD_CLOEXEC   0
#define pthread_mutex_init (   ...)
#define pthread_mutex_lock (   ...)
#define pthread_mutex_trylock (   ...)    (0)
#define pthread_mutex_unlock (   ...)

Variable Documentation

onion_poller_slot empty_slot
rlim_t max_slots
int refcount