From: Wu Y. <ad...@sh...> - 2004-05-27 15:11:35
|
On Thu, 2004-05-27 at 15:29, Danny Smith wrote: > > Anyway, I just want to provide a way out for W95/i386 in case trylock ever becomes > useful. I suppose its not important since its really hard to show a regression on code > that doesn't get used. It's even harder to show this regression on an OS/cpu combination > that probably exists only in dusty store rooms and rubbish tips. > > Danny Hi, Danny, I think one can put a #ifdef inside __gthr_win32_trylock to return -1, but it is just not worth while. After all, no people are expected to use an i386, running 32-bit Windows, and upgrade to new software. The new patch is here. ChangeLog: 2004-05-27 Wu Yongwei <ad...@sh...> * gthr-win32.h (__GTHREAD_MUTEX_INIT_DEFAULT): Adjust. (__gthr_i486_lock_cmp_xchg): New inline assembly function. (__GTHR_W32_InterlockedCompareExchange): New macro to choose a suitable function for interlocked compare-and-exchange. (__gthread_mutex_trylock): Use __GTHR_W32_InterlockedCompareExchange. (__gthread_mutex_init_function, __gthread_mutex_lock, __gthread_mutex_trylock, __gthread_mutex_unlock): Adjust the initial counter value to work correctly under Windows 95. * config/i386/gthr-win32.c: Adjust include order. Define __GTHREAD_I486_INLINE_LOCK_PRIMITIVES before including gthr-win32.h. (__gthr_win32_mutex_init_function, __gthr_win32_mutex_lock, __gthr_win32_mutex_trylock, __gthr_win32_mutex_unlock): Adjust to match inline versions in gthr-win32.h. Best regards, Yongwei |