Skip to content

Commit e8cb98f

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

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
@@ -104,8 +104,9 @@ namespace ESPressio {
104104

105105
/// Invokes the provided `callback` with the `Mutex` object locked.
106106
void WithReadLock(std::function<void(T&)> callback) {
107-
std::lock_guard<std::mutex> lock(_mutex);
107+
_mutex.lock();
108108
callback(_value);
109+
_mutex.unlock();
109110
}
110111

111112
void WithWriteLock(std::function<void(T&)> callback) {

0 commit comments

Comments
 (0)