diff options
author | Andrew Gregory <andrew.gregory.8@gmail.com> | 2014-09-29 00:11:39 +0200 |
---|---|---|
committer | Andrew Gregory <andrew.gregory.8@gmail.com> | 2017-05-11 06:45:30 +0200 |
commit | 4143760a944470d50975ee27da9e3380223e88b9 (patch) | |
tree | 1e975dd3aeb59ec888292d813c9a147d122153f4 /lib/libalpm/handle.h | |
parent | 5c2208294dc0b21a7aa40b9eb56f64f237c48efb (diff) | |
download | pacman-4143760a944470d50975ee27da9e3380223e88b9.tar.gz pacman-4143760a944470d50975ee27da9e3380223e88b9.tar.xz |
synchronize outside communication
Diffstat (limited to 'lib/libalpm/handle.h')
-rw-r--r-- | lib/libalpm/handle.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/libalpm/handle.h b/lib/libalpm/handle.h index 115c3481..9cf396ce 100644 --- a/lib/libalpm/handle.h +++ b/lib/libalpm/handle.h @@ -26,6 +26,7 @@ #include "alpm_list.h" #include "alpm.h" +#include "thread.h" #ifdef HAVE_LIBCURL #include <curl/curl.h> @@ -34,19 +35,25 @@ #define EVENT(h, e) \ do { \ if((h)->eventcb) { \ + _ALPM_TLOCK_CB(h); \ (h)->eventcb((alpm_event_t *) (e)); \ + _ALPM_TUNLOCK_CB(h); \ } \ } while(0) #define QUESTION(h, q) \ do { \ if((h)->questioncb) { \ + _ALPM_TLOCK_CB(h); \ (h)->questioncb((alpm_question_t *) (q)); \ + _ALPM_TUNLOCK_CB(h); \ } \ } while(0) #define PROGRESS(h, e, p, per, n, r) \ do { \ if((h)->progresscb) { \ + _ALPM_TLOCK_CB(h); \ (h)->progresscb(e, p, per, n, r); \ + _ALPM_TUNLOCK_CB(h); \ } \ } while(0) @@ -114,6 +121,11 @@ struct __alpm_handle_t { /* for delta parsing efficiency */ int delta_regex_compiled; regex_t delta_regex; + +#ifdef HAVE_PTHREAD + pthread_mutex_t tlock_cb; + pthread_mutex_t tlock_log; +#endif }; alpm_handle_t *_alpm_handle_new(void); |