summaryrefslogtreecommitdiff
path: root/libusb/libusbi.h
diff options
context:
space:
mode:
authorDaniel Drake <dsd@gentoo.org>2008-04-18 23:58:54 +0100
committerDaniel Drake <dsd@gentoo.org>2008-04-18 23:58:54 +0100
commit1fcdb0678b759569db7cd530457dbc0a5f86fb1d (patch)
tree40772dd266cf198b3ca87d03b0d28491664455e1 /libusb/libusbi.h
parent0efd2efa65d5513e5754d717d522b2c5c45332e2 (diff)
downloadlibusb-1fcdb0678b759569db7cd530457dbc0a5f86fb1d.tar.gz
libusb_device mutex protection
Diffstat (limited to 'libusb/libusbi.h')
-rw-r--r--libusb/libusbi.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/libusb/libusbi.h b/libusb/libusbi.h
index 19b28b6..7436491 100644
--- a/libusb/libusbi.h
+++ b/libusb/libusbi.h
@@ -143,8 +143,12 @@ void usbi_log(enum usbi_log_level, const char *function, const char *format, ...
#define usbi_err(fmt...) _usbi_log(LOG_LEVEL_ERROR, fmt)
struct libusb_device {
- struct list_head list;
+ /* lock protects refcnt, everything else is finalized at initialization
+ * time */
+ pthread_mutex_t lock;
int refcnt;
+
+ struct list_head list;
unsigned long session_data;
struct libusb_device_descriptor desc;
struct libusb_config_descriptor *config;