Skip to content

Commit 1f59c69

Browse files
committed
- Fixing Thread
1 parent be94b21 commit 1f59c69

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/ESPressio_ThreadSafe.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,9 @@ namespace ESPressio {
109109
}
110110

111111
void WithWriteLock(std::function<void(T&)> callback) {
112-
std::lock_guard<std::mutex> lock(_mutex);
112+
_mutex.lock();
113113
callback(_value);
114+
_mutex.unlock();
114115
}
115116

116117
/// Invokes the provided `callback` with the `Mutex` object locked, returning `false` if the thread-safe lock was not obtained.

0 commit comments

Comments
 (0)