libutil++  1.9.3
 All Classes Functions Variables
AutoMutex.cpp
1 /*
2 ** libutil++
3 ** $Id: AutoMutex.cpp 1653 2016-02-28 19:54:59Z sella $
4 ** Copyright (c) 2011-2016 Digital Genesis, LLC. All Rights Reserved.
5 ** Released under the LGPL Version 2.1 License.
6 ** http://www.digitalgenesis.com
7 */
8 
9 static const char rcsid[] __attribute__((used)) = "$Id: AutoMutex.cpp 1653 2016-02-28 19:54:59Z sella $";
10 
11 #include "AutoMutex.h"
12 
13 using namespace sella::util;
14 
15 AutoMutex::AutoMutex(pthread_mutex_t & mutex) throw () : mutex(mutex) { ::pthread_mutex_lock(&(this->mutex)); }
16 AutoMutex::~AutoMutex() throw () { ::pthread_mutex_unlock(&(this->mutex)); }
17 
18 /*
19 ** vim: noet ts=3 sw=3
20 */