aboutsummaryrefslogtreecommitdiff
path: root/src/zencore/include
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2026-02-17 13:56:33 +0100
committerGitHub Enterprise <[email protected]>2026-02-17 13:56:33 +0100
commit2159b2ce105935ce4d52a726094f9bbb91537d0c (patch)
tree6f8b21486d6dfa4e7d188bd83a56cbfdf4436b22 /src/zencore/include
parentadded ResetConsoleLog (#758) (diff)
downloadzen-2159b2ce105935ce4d52a726094f9bbb91537d0c.tar.xz
zen-2159b2ce105935ce4d52a726094f9bbb91537d0c.zip
misc fixes brought over from sb/proto (#759)
* `RwLock::WithSharedLock` and `RwLock::WithExclusiveLock` can now return a value (which is returned by the passed function) * Comma-separated logger specification now correctly deals with commas * `GetSystemMetrics` properly accounts for cores * cpr response formatter passes arguments in the right order * `HttpServerRequest::SetLogRequest` can be used to selectively log HTTP requests
Diffstat (limited to 'src/zencore/include')
-rw-r--r--src/zencore/include/zencore/thread.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/zencore/include/zencore/thread.h b/src/zencore/include/zencore/thread.h
index de8f9399c..a1c68b0b2 100644
--- a/src/zencore/include/zencore/thread.h
+++ b/src/zencore/include/zencore/thread.h
@@ -61,10 +61,10 @@ public:
RwLock* m_Lock;
};
- inline void WithSharedLock(auto&& Fun)
+ inline auto WithSharedLock(auto&& Fun)
{
SharedLockScope $(*this);
- Fun();
+ return Fun();
}
struct ExclusiveLockScope
@@ -85,10 +85,10 @@ public:
RwLock* m_Lock;
};
- inline void WithExclusiveLock(auto&& Fun)
+ inline auto WithExclusiveLock(auto&& Fun)
{
ExclusiveLockScope $(*this);
- Fun();
+ return Fun();
}
private: