~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/innobase/include/os0sync.ic

  • Committer: lbieber
  • Date: 2010-10-02 19:48:35 UTC
  • mfrom: (1730.6.19 drizzle-make-lcov)
  • Revision ID: lbieber@orisndriz08-20101002194835-q5zd9qc4lvx1xnfo
Merge Hartmut - clean up lex, now require flex to build, also "make lcov" improvements

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*****************************************************************************
2
2
 
3
 
Copyright (C) 1995, 2009, Innobase Oy. All Rights Reserved.
 
3
Copyright (c) 1995, 2009, Innobase Oy. All Rights Reserved.
4
4
 
5
5
This program is free software; you can redistribute it and/or modify it under
6
6
the terms of the GNU General Public License as published by the Free Software
11
11
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12
12
 
13
13
You should have received a copy of the GNU General Public License along with
14
 
this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
15
 
St, Fifth Floor, Boston, MA 02110-1301 USA
 
14
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
 
15
Place, Suite 330, Boston, MA 02111-1307 USA
16
16
 
17
17
*****************************************************************************/
18
18
 
30
30
#include <pthread.h>
31
31
 
32
32
/**********************************************************//**
33
 
Acquires ownership of a fast mutex.
 
33
Acquires ownership of a fast mutex. Currently in Windows this is the same
 
34
as os_fast_mutex_lock!
34
35
@return 0 if success, != 0 if was reserved by another thread */
35
36
UNIV_INLINE
36
37
ulint
39
40
        os_fast_mutex_t*        fast_mutex)     /*!< in: mutex to acquire */
40
41
{
41
42
#ifdef __WIN__
42
 
        if (TryEnterCriticalSection(fast_mutex)) {
43
 
 
44
 
                return(0);
45
 
        } else {
46
 
 
47
 
                return(1);
48
 
        }
 
43
        EnterCriticalSection(fast_mutex);
 
44
 
 
45
        return(0);
49
46
#else
50
47
        /* NOTE that the MySQL my_pthread.h redefines pthread_mutex_trylock
51
48
        so that it returns 0 on success. In the operating system