From 6df767863656d2e3efffed562a02180b3ea11624 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Thu, 25 Aug 2011 06:48:24 +0000 Subject: Bu::ItoLocker is rather handy, I like it. I reccomend it. --- src/itolocker.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 src/itolocker.cpp (limited to 'src/itolocker.cpp') diff --git a/src/itolocker.cpp b/src/itolocker.cpp new file mode 100644 index 0000000..17e97fd --- /dev/null +++ b/src/itolocker.cpp @@ -0,0 +1,13 @@ +#include "bu/itolocker.h" +#include "bu/itomutex.h" + +Bu::ItoLocker::ItoLocker( Bu::ItoMutex &mu ) : + mu( mu ) +{ + mu.lock(); +} + +Bu::ItoLocker::~ItoLocker() +{ + mu.unlock(); +} -- cgit v1.2.3