libutil++  1.9.3
 All Classes Functions Variables
AutoWriteLock.cpp
1 /*
2 ** libutil++
3 ** $Id: AutoWriteLock.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: AutoWriteLock.cpp 1653 2016-02-28 19:54:59Z sella $";
10 
11 #include "AutoWriteLock.h"
12 
13 using namespace sella::util;
14 
15 AutoWriteLock::AutoWriteLock(pthread_rwlock_t & lock) throw () : lock(lock) {
16  ::pthread_rwlock_wrlock(&(this->lock));
17 }
18 
19 AutoWriteLock::~AutoWriteLock() throw () {
20  ::pthread_rwlock_unlock(&(this->lock));
21 }
22 
23 /*
24 ** vim: noet ts=3 sw=3
25 */