summaryrefslogtreecommitdiffstats
path: root/lib/libalpm/handle.h
diff options
context:
space:
mode:
authorAndrew Gregory <andrew.gregory.8@gmail.com>2015-01-22 06:29:53 +0100
committerAndrew Gregory <andrew.gregory.8@gmail.com>2017-05-11 06:45:30 +0200
commit2e63d6aa7fcdfd89f02758f02f5799a291405b40 (patch)
tree03a2661f903afdbc6539b6530bf90aece2b4e55a /lib/libalpm/handle.h
parent4143760a944470d50975ee27da9e3380223e88b9 (diff)
downloadpacman-2e63d6aa7fcdfd89f02758f02f5799a291405b40.tar.gz
pacman-2e63d6aa7fcdfd89f02758f02f5799a291405b40.tar.xz
make pm_errno thread-local
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Diffstat (limited to 'lib/libalpm/handle.h')
-rw-r--r--lib/libalpm/handle.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/libalpm/handle.h b/lib/libalpm/handle.h
index 9cf396ce..10a430ac 100644
--- a/lib/libalpm/handle.h
+++ b/lib/libalpm/handle.h
@@ -28,6 +28,10 @@
#include "alpm.h"
#include "thread.h"
+#ifdef HAVE_PTHREAD
+#include <pthread.h>
+#endif
+
#ifdef HAVE_LIBCURL
#include <curl/curl.h>
#endif
@@ -112,9 +116,6 @@ struct __alpm_handle_t {
int remotefilesiglevel; /* Signature verification level for remote file
upgrade operations */
- /* error code */
- alpm_errno_t pm_errno;
-
/* lock file descriptor */
int lockfd;
@@ -125,6 +126,11 @@ struct __alpm_handle_t {
#ifdef HAVE_PTHREAD
pthread_mutex_t tlock_cb;
pthread_mutex_t tlock_log;
+ pthread_mutex_t tlock_task;
+ pthread_key_t tkey_err;
+#else
+ /* error code */
+ alpm_errno_t pm_errno;
#endif
};
@@ -137,6 +143,8 @@ int _alpm_handle_unlock(alpm_handle_t *handle);
alpm_errno_t _alpm_set_directory_option(const char *value,
char **storage, int must_exist);
+void _alpm_set_errno(alpm_handle_t *handle, alpm_errno_t err);
+
#endif /* ALPM_HANDLE_H */
/* vim: set noet: */