Necessity of __gthread_mutex_trylock

Wu Yongwei adah@netstd.com
Mon Feb 23 10:06:00 GMT 2004


This is written in the comment of gcc/gthr-win32.h and gcc/gthr-win32.cpp:

   We might consider using Critical Sections instead of Windows32
   mutexes for better performance, but emulating __gthread_mutex_trylock
   interface becomes more complicated (Win9x does not support
   TryEnterCriticalSectioni, while NT does).

However, grepping the GCC source and find no reference to 
__gthread_mutex_trylock except the gthr-* headers, I see no real use of 
it. Is it really necessary? Remove it and Win32 multi-threaded can 
behave better.

Just a question. :-)

Best regards,

Wu Yongwei



More information about the Libstdc++ mailing list