1 /*! ========================================================================
2 ** Extended Template and Library
3 ** NULL Mutex Abstraction Class Implementation
6 ** Copyright (c) 2002 Robert B. Quattlebaum Jr.
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.
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.
18 ** === N O T E S ===========================================================
20 ** This is an internal header file, included by other ETL headers.
21 ** You should not attempt to use it directly.
23 ** ========================================================================= */
25 /* === S T A R T =========================================================== */
27 #ifndef __ETL__MUTEX_NULL_H_
28 #define __ETL__MUTEX_NULL_H_
30 /* === H E A D E R S ======================================================= */
31 /* === M A C R O S ========================================================= */
33 /* === C L A S S E S & S T R U C T S ======================================= */
43 //! Exception-safe mutex lock class
49 lock(mutex &x):_mtx(&x) { _mtx->lock_mutex(); }
50 ~lock() { _mtx->unlock_mutex(); }
51 mutex &get() { return *_mtx; }
57 lock(mutex_null &/*x*/) { }
61 bool try_lock_mutex(){return true;}
67 /* === E X T E R N S ======================================================= */
69 /* === E N D =============================================================== */