DDraceNetwork Documentation
Loading...
Searching...
No Matches
aio.cpp File Reference
#include "aio.h"
#include "io.h"
#include "lock.h"
#include "mem.h"
#include "sphore.h"
#include "thread.h"
#include <cstdlib>
Include dependency graph for aio.cpp:

Classes

struct  ASYNCIO
struct  BUFFERS

Macros

#define ASYNC_BUFSIZE   (8 * 1024)
#define ASYNC_LOCAL_BUFSIZE   (64 * 1024)

Enumerations

enum  { ASYNCIO_RUNNING , ASYNCIO_CLOSE , ASYNCIO_EXIT }

Functions

static void buffer_ptrs (ASYNCIO *aio, struct BUFFERS *buffers)
static void aio_handle_free_and_unlock (ASYNCIO *aio)
static void aio_thread (void *user)
ASYNCIOaio_new (IOHANDLE io)
static unsigned int buffer_len (ASYNCIO *aio)
static unsigned int next_buffer_size (unsigned int cur_size, unsigned int need_size)
void aio_lock (ASYNCIO *aio)
void aio_unlock (ASYNCIO *aio)
void aio_write_unlocked (ASYNCIO *aio, const void *buffer, unsigned size)
void aio_write (ASYNCIO *aio, const void *buffer, unsigned size)
void aio_write_newline_unlocked (ASYNCIO *aio)
void aio_write_newline (ASYNCIO *aio)
int aio_error (ASYNCIO *aio)
void aio_close (ASYNCIO *aio)
void aio_wait (ASYNCIO *aio)
void aio_free (ASYNCIO *aio)

Macro Definition Documentation

◆ ASYNC_BUFSIZE

#define ASYNC_BUFSIZE   (8 * 1024)

◆ ASYNC_LOCAL_BUFSIZE

#define ASYNC_LOCAL_BUFSIZE   (64 * 1024)

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
ASYNCIO_RUNNING 
ASYNCIO_CLOSE 
ASYNCIO_EXIT 

Function Documentation

◆ aio_handle_free_and_unlock()

void aio_handle_free_and_unlock ( ASYNCIO * aio)
static

◆ aio_thread()

void aio_thread ( void * user)
static

◆ buffer_len()

unsigned int buffer_len ( ASYNCIO * aio)
static

◆ buffer_ptrs()

void buffer_ptrs ( ASYNCIO * aio,
struct BUFFERS * buffers )
static

◆ next_buffer_size()

unsigned int next_buffer_size ( unsigned int cur_size,
unsigned int need_size )
static