1
/******************************************************
2
The interface to the operating system synchronization primitives.
6
Created 9/6/1995 Heikki Tuuri
7
*******************************************************/
13
/**************************************************************
14
Acquires ownership of a fast mutex. Currently in Windows this is the same
15
as os_fast_mutex_lock! */
18
os_fast_mutex_trylock(
19
/*==================*/
20
/* out: 0 if success, != 0 if
21
was reserved by another
23
os_fast_mutex_t* fast_mutex) /* in: mutex to acquire */
26
EnterCriticalSection(fast_mutex);
30
#if defined(UNIV_HOTBACKUP) && defined(UNIV_HPUX10)
31
/* Since the hot backup version is standalone, MySQL does not redefine
32
pthread_mutex_trylock for HP-UX-10.20, and consequently we must invert
33
the return value here */
35
return((ulint) (1 - pthread_mutex_trylock(fast_mutex)));
37
/* NOTE that the MySQL my_pthread.h redefines pthread_mutex_trylock
38
so that it returns 0 on success. In the operating system
39
libraries, HP-UX-10.20 follows the old Posix 1003.4a Draft 4 and
40
returns 1 on success (but MySQL remaps that to 0), while Linux,
41
FreeBSD, Solaris, AIX, Tru64 Unix, HP-UX-11.0 return 0 on success. */
43
return((ulint) pthread_mutex_trylock(fast_mutex));