First public contribution.
1 // Copyright (C) 2000 Stephen Cleary
3 // Distributed under the Boost Software License, Version 1.0. (See
4 // accompanying file LICENSE_1_0.txt or copy at
5 // http://www.boost.org/LICENSE_1_0.txt)
7 // See http://www.boost.org for updates, documentation, and revision history.
9 #ifndef BOOST_POOL_GUARD_HPP
10 #define BOOST_POOL_GUARD_HPP
12 // Extremely Light-Weight guard glass
19 template <typename Mutex>
26 void operator=(const guard &);
29 explicit guard(Mutex & nmtx)
30 :mtx(nmtx) { mtx.lock(); }
32 ~guard() { mtx.unlock(); }
36 } // namespace details