~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

  • Committer: Monty Taylor
  • Date: 2011-02-13 17:26:39 UTC
  • mfrom: (2157.2.2 give-in-to-pkg-config)
  • mto: This revision was merged to the branch mainline in revision 2166.
  • Revision ID: mordred@inaugust.com-20110213172639-nhy7i72sfhoq13ms
Merged in pkg-config fixes.

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
30
30
#include <pthread.h>
31
31
 
32
32
/**********************************************************//**
33
 
Acquires ownership of a fast mutex. Currently in Windows this is the same
34
 
as os_fast_mutex_lock!
 
33
Acquires ownership of a fast mutex.
35
34
@return 0 if success, != 0 if was reserved by another thread */
36
35
UNIV_INLINE
37
36
ulint
40
39
        os_fast_mutex_t*        fast_mutex)     /*!< in: mutex to acquire */
41
40
{
42
41
#ifdef __WIN__
43
 
        EnterCriticalSection(fast_mutex);
44
 
 
45
 
        return(0);
 
42
        if (TryEnterCriticalSection(fast_mutex)) {
 
43
 
 
44
                return(0);
 
45
        } else {
 
46
 
 
47
                return(1);
 
48
        }
46
49
#else
47
50
        /* NOTE that the MySQL my_pthread.h redefines pthread_mutex_trylock
48
51
        so that it returns 0 on success. In the operating system