Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove unused scoped_unlock, unlock_guard_try
- Loading branch information
Showing
7 changed files
with
36 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,24 @@ | ||
// Copyright (c) 2007-2008 Chirag Dekate, Hartmut Kaiser | ||
// Copyright (c) 2015 Agustin Berge | ||
// | ||
// Distributed under the Boost Software License, Version 1.0. (See accompanying | ||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | ||
|
||
#if !defined(HPX_UTIL_SCOPED_UNLOCK_JUN_17_2008_1131AM) | ||
#define HPX_UTIL_SCOPED_UNLOCK_JUN_17_2008_1131AM | ||
#ifndef HPX_UTIL_SCOPED_UNLOCK_HPP | ||
#define HPX_UTIL_SCOPED_UNLOCK_HPP | ||
|
||
#include <hpx/config.hpp> | ||
|
||
#if defined(HPX_HAVE_SCOPED_UNLOCK_COMPATIBILITY) | ||
#include <hpx/util/unlock_guard.hpp> | ||
|
||
/////////////////////////////////////////////////////////////////////////////// | ||
namespace hpx { namespace util | ||
{ | ||
/////////////////////////////////////////////////////////////////////////// | ||
// This is a helper structure to make sure a lock gets unlocked and locked | ||
// again in a scope. | ||
template <typename Lock> | ||
struct scoped_unlock | ||
{ | ||
scoped_unlock(Lock& l) : l_(l) | ||
{ | ||
l_.unlock(); | ||
} | ||
~scoped_unlock() | ||
{ | ||
l_.lock(); | ||
} | ||
|
||
Lock& l_; | ||
}; | ||
|
||
/////////////////////////////////////////////////////////////////////////////// | ||
using scoped_unlock = unlock_guard<Lock>; | ||
}} | ||
|
||
#else | ||
# error This header exists for compatibility reasons, use <hpx/util/unlock_guard.hpp> instead. | ||
#endif | ||
|
||
#endif /*HPX_UTIL_SCOPED_UNLOCK_HPP*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters