From 4143760a944470d50975ee27da9e3380223e88b9 Mon Sep 17 00:00:00 2001 From: Andrew Gregory Date: Sun, 28 Sep 2014 18:11:39 -0400 Subject: synchronize outside communication --- lib/libalpm/handle.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'lib/libalpm/handle.c') 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 */ -- cgit v1.2.3-24-g4f1b