Skip to content

Commit

Permalink
Fixed mutex type in utility function in ScopedRemover
Browse files Browse the repository at this point in the history
  • Loading branch information
wqking committed Sep 19, 2023
1 parent db34021 commit 31f27d4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions include/eventpp/utilities/scopedremover.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ namespace eventpp {

namespace internal_ {

template <typename Item, typename Handle>
bool removeHandleFromScopedRemoverItemList(std::vector<Item> & itemList, Handle & handle, std::mutex & mutex)
template <typename Item, typename Handle, typename Mutex>
bool removeHandleFromScopedRemoverItemList(std::vector<Item> & itemList, Handle & handle, Mutex & mutex)
{
if(! handle) {
return false;
}
auto handlePointer = handle.lock();
std::unique_lock<std::mutex> lock(mutex);
std::unique_lock<Mutex> lock(mutex);
auto it = std::find_if(itemList.begin(), itemList.end(), [&handlePointer](Item & item) {
return item.handle && item.handle.lock() == handlePointer;
});
Expand Down

0 comments on commit 31f27d4

Please sign in to comment.