00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 #ifndef APR_RESLIST_H
00018 #define APR_RESLIST_H
00019 
00025 #include "apr.h"
00026 #include "apu.h"
00027 #include "apr_pools.h"
00028 #include "apr_errno.h"
00029 #include "apr_time.h"
00030 
00031 #if APR_HAS_THREADS
00032 
00042 #ifdef __cplusplus
00043 extern "C" {
00044 #endif 
00045 
00047 typedef struct apr_reslist_t apr_reslist_t;
00048 
00049 
00050 
00051 
00052 
00053 
00054 
00055 typedef apr_status_t (*apr_reslist_constructor)(void **resource, void *params,
00056                                                 apr_pool_t *pool);
00057 
00058 
00059 
00060 
00061 
00062 
00063 
00064 typedef apr_status_t (*apr_reslist_destructor)(void *resource, void *params,
00065                                                apr_pool_t *pool);
00066 
00094 APU_DECLARE(apr_status_t) apr_reslist_create(apr_reslist_t **reslist,
00095                                              int min, int smax, int hmax,
00096                                              apr_interval_time_t ttl,
00097                                              apr_reslist_constructor con,
00098                                              apr_reslist_destructor de,
00099                                              void *params,
00100                                              apr_pool_t *pool);
00101 
00113 APU_DECLARE(apr_status_t) apr_reslist_destroy(apr_reslist_t *reslist);
00114 
00120 APU_DECLARE(apr_status_t) apr_reslist_acquire(apr_reslist_t *reslist,
00121                                               void **resource);
00122 
00126 APU_DECLARE(apr_status_t) apr_reslist_release(apr_reslist_t *reslist,
00127                                               void *resource);
00128 
00135 APU_DECLARE(void) apr_reslist_timeout_set(apr_reslist_t *reslist,
00136                                           apr_interval_time_t timeout);
00137 
00142 APU_DECLARE(apr_uint32_t) apr_reslist_acquired_count(apr_reslist_t *reslist);
00143 
00149 APU_DECLARE(apr_status_t) apr_reslist_invalidate(apr_reslist_t *reslist,
00150                                                  void *resource);
00151 
00152 
00153 #ifdef __cplusplus
00154 }
00155 #endif
00156 
00159 #endif  
00160 
00161 #endif