diff options
author | Chris Dickens <christopher.a.dickens@gmail.com> | 2014-11-17 23:53:08 -0800 |
---|---|---|
committer | Chris Dickens <chris.dickens@hp.com> | 2014-12-19 11:12:48 -0800 |
commit | 0e62e5cf34cd02e811157ecb4c6725f2b940a136 (patch) | |
tree | c988212fe5dfc2800588497fd7f2ebbeabcfa9e8 /libusb/io.c | |
parent | c57953cfb3c8ecd4c51d34b7a2982713925530cd (diff) | |
download | libusb-0e62e5cf34cd02e811157ecb4c6725f2b940a136.tar.gz |
core: Add new lock to protect internal context event data
This lock will be used in subsequent changes that will consolidate
all different event sources (i.e. device close, fd notification,
hotplug message) into a single event.
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
Diffstat (limited to 'libusb/io.c')
-rw-r--r-- | libusb/io.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libusb/io.c b/libusb/io.c index 7700e8c..2b3c755 100644 --- a/libusb/io.c +++ b/libusb/io.c @@ -1114,6 +1114,7 @@ int usbi_io_init(struct libusb_context *ctx) usbi_mutex_init(&ctx->pollfds_lock, NULL); usbi_mutex_init(&ctx->device_close_lock, NULL); usbi_mutex_init_recursive(&ctx->events_lock, NULL); + usbi_mutex_init(&ctx->event_data_lock, NULL); usbi_mutex_init(&ctx->event_waiters_lock, NULL); usbi_cond_init(&ctx->event_waiters_cond, NULL); list_init(&ctx->flying_transfers); @@ -1175,6 +1176,7 @@ err: usbi_mutex_destroy(&ctx->pollfds_lock); usbi_mutex_destroy(&ctx->device_close_lock); usbi_mutex_destroy(&ctx->events_lock); + usbi_mutex_destroy(&ctx->event_data_lock); usbi_mutex_destroy(&ctx->event_waiters_lock); usbi_cond_destroy(&ctx->event_waiters_cond); return r; @@ -1198,6 +1200,7 @@ void usbi_io_exit(struct libusb_context *ctx) usbi_mutex_destroy(&ctx->pollfds_lock); usbi_mutex_destroy(&ctx->device_close_lock); usbi_mutex_destroy(&ctx->events_lock); + usbi_mutex_destroy(&ctx->event_data_lock); usbi_mutex_destroy(&ctx->event_waiters_lock); usbi_cond_destroy(&ctx->event_waiters_cond); if (ctx->pollfds) |