pool.c File Reference

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <pthread.h>
#include <fuse/fuse.h>
#include "query.h"
#include "pool.h"
#include "log.h"

Include dependency graph for pool.c:

Go to the source code of this file.

Data Structures

struct  pool_lifo
 Used in lifo_put() and lifo_get() to maintain a LIFO list. More...

Functions

int pool_init (struct mysqlfs_opt *opt_arg)
 Initalize pool and preallocate connections.
void pool_cleanup ()
 Close all connections and cleanup pool.
void * pool_get ()
 Get DB connection from pool.
void pool_put (void *conn)
 Put DB connection back to the pool.

Variables

mysqlfs_optopt
pool_lifolifo_pool = NULL
pool_lifolifo_unused = NULL
unsigned int lifo_unused_cnt = 0
unsigned int lifo_pool_cnt = 0


Function Documentation

void pool_cleanup (  ) 

Close all connections and cleanup pool.

Definition at line 200 of file pool.c.

References LOG_D_POOL, and log_printf().

Referenced by main().

Here is the call graph for this function:

void* pool_get (  ) 

Get DB connection from pool.

Definition at line 210 of file pool.c.

References LOG_D_POOL, and log_printf().

Referenced by pool_init().

Here is the call graph for this function:

int pool_init ( struct mysqlfs_opt opt_arg  ) 

Initalize pool and preallocate connections.

Definition at line 172 of file pool.c.

References mysqlfs_opt::init_conns, LOG_D_POOL, log_printf(), opt, pool_get(), and pool_put().

Referenced by main().

Here is the call graph for this function:

void pool_put ( void *  conn  ) 

Put DB connection back to the pool.

Definition at line 222 of file pool.c.

References lifo_pool_cnt, LOG_D_POOL, log_printf(), mysqlfs_opt::max_idling_conns, and opt.

Referenced by pool_init().

Here is the call graph for this function:


Variable Documentation

struct pool_lifo* lifo_pool = NULL

Definition at line 41 of file pool.c.

unsigned int lifo_pool_cnt = 0

Definition at line 45 of file pool.c.

Referenced by pool_put().

struct pool_lifo* lifo_unused = NULL

Definition at line 42 of file pool.c.

unsigned int lifo_unused_cnt = 0

Definition at line 44 of file pool.c.

struct mysqlfs_opt* opt

Definition at line 32 of file pool.c.

Referenced by main(), pool_init(), and pool_put().


Generated on Sun Jul 12 20:25:27 2009 for mysqlfs by  doxygen 1.4.7