rename lock create callback functions; as suggested by nick

svn:r691
This commit is contained in:
Niels Provos 2008-03-11 05:26:30 +00:00
parent c182baca10
commit cb50f615d4
3 changed files with 10 additions and 6 deletions

View File

@ -1213,7 +1213,7 @@ evthread_set_id_callback(struct event_base *base,
}
void
evthread_set_create_callback(struct event_base *base,
evthread_set_lock_create_callbacks(struct event_base *base,
void *(*alloc_fn)(void), void (*free_fn)(void *))
{
#ifdef DISABLE_THREAD_SUPPORT

View File

@ -63,10 +63,15 @@ extern "C" {
#define EVTHREAD_READ 0x08
/**
Sets the function libevent should use for allocating and freeing
locks.
Sets the functions libevent should use for allocating and freeing
locks. This needs to be called in addition to
evthread_set_locking_callback() before using libevent in a
multi-threaded application.
@param alloc_fn function to be called when allocating a new lock
@param free_fn function to be called to a free a lock
*/
void evthread_set_create_callback(struct event_base *base,
void evthread_set_lock_create_callbacks(struct event_base *base,
void *(*alloc_fn)(void), void (*free_fn)(void *));
struct event_base;

View File

@ -165,11 +165,10 @@ void
regress_pthread(void)
{
struct event_base *base = event_base_new();
int i;
pthread_mutex_init(&count_lock, NULL);
evthread_set_create_callback(base, alloc_lock, free_lock);
evthread_set_lock_create_callbacks(base, alloc_lock, free_lock);
evthread_set_locking_callback(base, locking);
evthread_set_id_callback(base, get_id);