diff options
Diffstat (limited to 'lib/libalpm/handle.c')
-rw-r--r-- | lib/libalpm/handle.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/libalpm/handle.c b/lib/libalpm/handle.c index 08625e3a..941bdd25 100644 --- a/lib/libalpm/handle.c +++ b/lib/libalpm/handle.c @@ -47,6 +47,11 @@ alpm_handle_t *_alpm_handle_new(void) handle->deltaratio = 0.0; handle->lockfd = -1; +#ifdef HAVE_PTHREAD + pthread_mutex_init(&(handle->tlock_cb), NULL); + pthread_mutex_init(&(handle->tlock_log), NULL); +#endif + return handle; } @@ -75,6 +80,11 @@ void _alpm_handle_free(alpm_handle_t *handle) FREELIST(handle->known_keys); #endif +#ifdef HAVE_PTHREAD + pthread_mutex_destroy(&(handle->tlock_cb)); + pthread_mutex_destroy(&(handle->tlock_log)); +#endif + regfree(&handle->delta_regex); /* free memory */ |