diff options
author | unknown <msvensson@pilot.mysql.com> | 2007-10-03 21:38:32 +0200 |
---|---|---|
committer | unknown <msvensson@pilot.mysql.com> | 2007-10-03 21:38:32 +0200 |
commit | 62db27def97ce3345a4e1dbcf0404c627ad73527 (patch) | |
tree | c537085b7010b4e17f0b3c2e7bc1d3f2e8bf2311 /include | |
parent | 79e4f390d9efb01ad188884cb698e1922d5c0c23 (diff) | |
download | mariadb-git-62db27def97ce3345a4e1dbcf0404c627ad73527.tar.gz |
Bug#30992 Wrong implementation of pthread_mutex_trylock()
It's not possible to use WaitForSingleObject to wait
on a CRITICAL_SECTION, instead use the TryEnterCriticalSection function.
- if "mutex" was already taken => return EBUSY
- if "mutex" was aquired => return 0
include/config-win.h:
Make windows.h define TryEnterCriticalSection
mysys/my_winthread.c:
Use the TryEnterCriticalSection function to implement pthread_mutex_trylock
Prevent recursive behaviour by looking at the RecursionCount variable
in the CRITICAL_SECTION struct and return EBUSY from function if
the mutex was already locked once.
Diffstat (limited to 'include')
-rw-r--r-- | include/config-win.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/config-win.h b/include/config-win.h index 279be7aa5e4..f0804a368bc 100644 --- a/include/config-win.h +++ b/include/config-win.h @@ -19,6 +19,9 @@ /* We have to do this define before including windows.h to get the AWE API functions */ #define _WIN32_WINNT 0x0500 +#else +/* Get NT 4.0 functions */ +#define _WIN32_WINNT 0x0400 #endif #if defined(_MSC_VER) && _MSC_VER >= 1400 |