F´ Flight Software - C/C++ Documentation  devel
A framework for building embedded system applications to NASA flight quality standards.
LockGuard.cpp
Go to the documentation of this file.
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 
13 #include "Utils/LockGuard.hpp"
14 
15 namespace Utils {
16 
18  LockGuard (
19  Os::Mutex& mutex
20  ) :
21  m_mutex(mutex)
22  {
23  this->m_mutex.lock();
24  }
25 
27  ~LockGuard ()
28  {
29  this->m_mutex.unLock();
30  }
31 
32 } // end namespace Utils
void unLock()
unlock the mutex
Definition: Mutex.cpp:13
void lock()
lock the mutex
Definition: Mutex.cpp:12
LockGuard(Os::Mutex &mutex)
Definition: LockGuard.cpp:18