WinCE: Fix race between wince_clock_gettime_threaded() and wince_clock_gettime()
commitb3562727e9cb75bf503c476452c9378c79385e71
authorSimon Haggett <simon.haggett@realvnc.com>
Fri, 12 Jul 2013 09:06:00 +0000 (12 10:06 +0100)
committerPete Batard <pete@akeo.ie>
Wed, 7 Aug 2013 23:41:46 +0000 (8 00:41 +0100)
tree6e7a4b7a8047540a8bdfe5ec20663ae3378a145e
parent388a9a88059cb5b5a8088788f5ccd6c3eec80f62
WinCE: Fix race between wince_clock_gettime_threaded() and wince_clock_gettime()

* When the timer thread is created in wince_init(), it performs an initialisation
  phase in which it uses QueryPerformanceFrequency() to determine if there is a
  high resolution timer available, and sets hires_frequency and hires_ticks_to_ps
  appropriately. However, since wince_init() does not wait for this initialisation
  phase to complete, wince_clock_gettime() can be called before hires_frequency
  and hires_ticks_to_ps have been updated. This can result in
  wince_clock_gettime() temporarily returning real-time clock values even though
  the platform supports a monotonic clock.
* See http://sourceforge.net/mailarchive/forum.php?thread_name=1373619997-3535-1-git-send-email-simon.haggett%40realvnc.com&forum_name=libusbx-devel
libusb/os/wince_usb.c
libusb/version_nano.h