LockGuard.cpp 672 B

1234567891011121314151617181920212223242526272829303132
  1. // ======================================================================
  2. // \title LockGuard.cpp
  3. // \author vwong
  4. // \brief cpp file for a lock guard utility class
  5. //
  6. //
  7. // \copyright
  8. // Copyright (C) 2009-2020 California Institute of Technology.
  9. // ALL RIGHTS RESERVED. United States Government Sponsorship
  10. // acknowledged.
  11. // ======================================================================
  12. #include "Utils/LockGuard.hpp"
  13. namespace Utils {
  14. LockGuard ::
  15. LockGuard (
  16. Os::Mutex& mutex
  17. ) :
  18. m_mutex(mutex)
  19. {
  20. this->m_mutex.lock();
  21. }
  22. LockGuard ::
  23. ~LockGuard ()
  24. {
  25. this->m_mutex.unLock();
  26. }
  27. } // end namespace Utils