Add internal abstraction for POSIX Threads
authorPeter Stuge <peter@stuge.se>
Mon, 10 May 2010 23:51:43 +0000 (00:51 +0100)
committerDaniel Drake <dan@reactivated.net>
Thu, 13 May 2010 01:11:29 +0000 (22:11 -0300)
commit23b5db8b3e353176dfa0635bfb6f0e2658f6e3de
treefa8d63b97d0ae45724eb2ebd2cc13853dae93993
parenta04cbb0095a78aeed3f65aaf06c46069d0ac184a
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 THREAD_CFLAGS in
configure.ac. This will enable optional use of -lpthread for cygwin.

[dsd: minor tweaks, and roll in a change based on patches from Pete
Batard to only build dpfp_threaded example when we're using pthreads]
AUTHORS
configure.ac
examples/Makefile.am
libusb/Makefile.am
libusb/core.c
libusb/io.c
libusb/libusbi.h
libusb/os/darwin_usb.c
libusb/os/linux_usbfs.c
libusb/os/threads_posix.h [new file with mode: 0644]