summaryrefslogtreecommitdiff
path: root/libusb/sync.c
Commit message (Collapse)AuthorAgeFilesLines
* includes simplification and cleanup (core)Pete Batard2010-02-241-2/+1
|
* merge abstraction for POSIX Threads and integration changes (Michael Plante, ↵r169Pete Batard2010-02-241-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Peter Stuge) v1.0.6 release Darwin: support multiple calls to libusb_init Credit to Orin Eman for finding this bug. Darwin: use logging functions Use usbi_warn, usbi_err, and usbi_info instead of _usbi_log. Darwin: fix memory leak in process_device Credit to Mike Colagrosso for finding this bug. Add internal abstraction for POSIX Threads This prepares for a Windows backend without dependency on pthreads-w32. pthread_* is renamed to usbi_* and PTHREAD_* to USBI_*. A usbi_mutex_static_t and usbi_mutex_static_lock() and _unlock() are introduced for statically initialized mutexes, since they may be implemented using other types when pthreads mutexes aren't used. Move -pthread from libusb/Makefile.am to host-specific AM_CFLAGS in configure.ac. AM_CFLAGS is already used in Makefile.am. (Numerous merge conflicts resolved by Michael Plante) misc fixes to pthreads abstraction * windows_compat.h should not be directly included (use libusbi.h) * windows_usb.c still had some references to pthread_mutex_[un]lock Add libusb_strerror() to get short error message in English from enum (Merge conflicts resolved by Michael Plante) Better cleanup on errors, stricter types and some good casts Avoid various memory leaks in error code paths and remove warnings. Also add usbi_cond_destroy in os/threads_posix.h because it's used for cleanup now. (Merge conflicts resolved by Michael Plante) Rename all interface parameters to usb_interface or interface_number (Merge conflicts resolved by Michael Plante) Add type parameter to the list_for_each_entry() and _safe() macros (Merge conflicts resolved by Michael Plante) VA_ARGS workaround for logging with MSVC6 (Merge conflicts resolved by Michael Plante) Fix context memory leak in libusb_init() * Now holds default_context_lock for duration of libusb_init * Doesn't allocate it if not needed Fix the last MSVC /W3 warning removal of pthreads from MSVC and mingw * removed pthread*.lib from linking in msvc6 (2005/8 not yet edited) * added threads_windows.[ch] to all project files in msvc6 * added usbi_cond_signal to both threading versions, unused * added native windows threading code, now used removed redundant time.h includes removed pthread-win32 informational solution files updated MSVC 2005/2008 for thread abstraction fixed DDK build fixed cygwin's use of POSIX threads fixed dpfp/dpfp_threaded for MinGW compatibility config_msvc.h -> msvc/config.h pthread abstraction for DLL project files fixed bad reference to thread_windows in 2005 DLL vcproj cygwin ifdef is not required in threads_windows.h - removed fixed residuals from previous patches moved thread source detection into autotool scripts
* Fix CR/LF inconsistenciesPete Batard2010-01-141-3/+3
|
* svn r54: - fixes missing config_msvc.hPete Batard2010-01-141-0/+4
|
* Clarify that timeout 0 means unlimited timeoutDaniel Drake2009-09-141-6/+6
|
* Make synchronous transfer APIs robust against signal interruptionDavid Moore2009-05-291-0/+4
| | | | | | | | | | | | libusb_control_transfer and libusb_bulk_transfer are designed to be synchronous such that control is not returned until the transfer definitively succeeds or fails. That assumption is violated if a signal interrupts these functions because there is no way for the application to continue waiting for the transfer without resubmitting it. This patch changes these synchronous APIs so they do not abort in the case of a signal interruption. Signed-off-by: David Moore <dcm@acm.org>
* Introduce contexts to the APIDaniel Drake2008-06-261-6/+8
| | | | | Suggested by David Zeuthen. This allows multiple libraries in the same process to independently use libusb without interfering.
* Overflow handlingDaniel Drake2008-06-201-0/+7
|
* Fix memory leak in libusb_control_transferDaniel Drake2008-05-191-0/+1
| | | | Pointed out by David Engraf: we weren't freeing the transfer buffer
* Handle hot-unpluggingDaniel Drake2008-05-111-0/+9
| | | | | This involved moving from select() to poll() because there is no way to distinguish usbfs's POLLERR condition with select().
* Endianness of control setup packetsDaniel Drake2008-05-111-2/+7
| | | | | | | | Document behaviour where host-endian and bus-endian (little) should be used respectively. Also remove packed attribute from libusb_control_setup as all fields are naturally aligned.
* documentation touchupsDaniel Drake2008-05-051-2/+1
|
* Detect endpoint halts and unsupported control requestsDaniel Drake2008-05-051-0/+10
|
* sanitized error returns from synchronous I/O functionsDaniel Drake2008-05-041-13/+13
|
* Rename endpoint_type to transfer_typeDaniel Drake2008-04-291-4/+4
| | | | Matches the USB specs more closely
* Remove libusb_cancel_transfer_syncDaniel Drake2008-04-291-2/+8
| | | | | This wasn't a particularly nice API. Cancellation should be handled by the completion handler.
* Documentation touchupsDaniel Drake2008-04-271-3/+34
| | | | | Detail that interrupt polling interval is fixed to endpoint bInterval, and that data may be transferred even on a timeout condition.
* Rename libusb_poll() to libusb_handle_events()Daniel Drake2008-03-301-2/+2
|
* Isochronous endpoint I/ODaniel Drake2008-03-301-2/+2
| | | | | | | | | Due to variable-sized structures, this involved changing allocation mechanism. All transfers must now be allocated and freed through libusb. A synchronous function is missing, and I could do with writing a few more helper functions to simplify things.
* it's called bmRequestTypeDaniel Drake2008-03-201-7/+7
|
* API documentationDaniel Drake2008-03-201-1/+70
| | | | | Hopefully mostly complete. Some constants were renamed and move into enums.
* Simplify libusb_fill_control_transfer()Daniel Drake2008-03-101-3/+2
| | | | Transfer length can be inferred from the setup packet.
* Simplify cancellation APIDaniel Drake2008-03-091-2/+2
| | | | No need to provide the device here.
* Rename libusb_dev_handle to libusb_device_handleDaniel Drake2008-03-091-6/+6
|
* Move synchronous I/O implementation to its own fileDaniel Drake2008-03-091-0/+169