_mutex_null.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*! ========================================================================
  2. ** Extended Template and Library
  3. ** NULL Mutex Abstraction Class Implementation
  4. **
  5. ** Copyright (c) 2002 Robert B. Quattlebaum Jr.
  6. **
  7. ** This package is free software; you can redistribute it and/or
  8. ** modify it under the terms of the GNU General Public License as
  9. ** published by the Free Software Foundation; either version 2 of
  10. ** the License, or (at your option) any later version.
  11. **
  12. ** This package is distributed in the hope that it will be useful,
  13. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. ** General Public License for more details.
  16. **
  17. ** === N O T E S ===========================================================
  18. **
  19. ** This is an internal header file, included by other ETL headers.
  20. ** You should not attempt to use it directly.
  21. **
  22. ** ========================================================================= */
  23. #ifndef __ETL__MUTEX_NULL_H_
  24. #define __ETL__MUTEX_NULL_H_
  25. _ETL_BEGIN_NAMESPACE
  26. class mutex_null
  27. {
  28. public:
  29. mutex_null() {}
  30. ~mutex_null() {}
  31. // Exception-safe mutex lock class
  32. class lock
  33. {
  34. public:
  35. lock(mutex_null &/*x*/) { }
  36. };
  37. void lock_mutex() {}
  38. bool try_lock_mutex()
  39. {
  40. return true;
  41. }
  42. void unlock_mutex() {}
  43. };
  44. _ETL_END_NAMESPACE
  45. #endif