Fix bugs in previous commit that caused FTBFS in synfig and ETL FTBFS with older...
[synfig.git] / ETL / tags / ETL_0_04_08 / ETL / ETL / _mutex_null.h
1 /*! ========================================================================
2 ** Extended Template and Library
3 ** NULL Mutex Abstraction Class Implementation
4 ** $Id: _mutex_null.h,v 1.1.1.1 2005/01/04 01:31:48 darco Exp $
5 **
6 ** Copyright (c) 2002 Robert B. Quattlebaum Jr.
7 **
8 ** This package is free software; you can redistribute it and/or
9 ** modify it under the terms of the GNU General Public License as
10 ** published by the Free Software Foundation; either version 2 of
11 ** the License, or (at your option) any later version.
12 **
13 ** This package is distributed in the hope that it will be useful,
14 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
15 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16 ** General Public License for more details.
17 **
18 ** === N O T E S ===========================================================
19 **
20 ** This is an internal header file, included by other ETL headers.
21 ** You should not attempt to use it directly.
22 **
23 ** ========================================================================= */
24
25 /* === S T A R T =========================================================== */
26
27 #ifndef __ETL__MUTEX_NULL_H_
28 #define __ETL__MUTEX_NULL_H_
29
30 /* === H E A D E R S ======================================================= */
31 /* === M A C R O S ========================================================= */
32
33 /* === C L A S S E S & S T R U C T S ======================================= */
34
35 _ETL_BEGIN_NAMESPACE
36
37 class mutex_null
38 {
39 public:
40
41         mutex_null(){}
42         ~mutex_null(){}
43         //! Exception-safe mutex lock class
44 /*
45         class lock
46         {
47                 mutex *_mtx;
48         public:
49                 lock(mutex &x):_mtx(&x) { _mtx->lock_mutex(); }
50                 ~lock() { _mtx->unlock_mutex(); }
51                 mutex &get() { return *_mtx; }
52         };
53 */
54         class lock
55         {
56         public:
57                 lock(mutex_null &x) { }
58         };
59         
60         void lock_mutex(){}
61         bool try_lock_mutex(){return true;}
62         void unlock_mutex(){}
63 };
64
65 _ETL_END_NAMESPACE
66
67 /* === E X T E R N S ======================================================= */
68
69 /* === E N D =============================================================== */
70
71 #endif