summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2021-02-01 01:54:10 +0100
committerbunnei <bunneidev@gmail.com>2021-02-05 23:03:36 +0100
commit18175c71edf90eeb73c6f47745b2bad32e4a1478 (patch)
treebbbdf4a73a37aa3d77a7e29ed0d5af9a47190324
parenthle: kernel: Reimplement KReadableEvent and KWritableEvent. (diff)
downloadyuzu-18175c71edf90eeb73c6f47745b2bad32e4a1478.tar
yuzu-18175c71edf90eeb73c6f47745b2bad32e4a1478.tar.gz
yuzu-18175c71edf90eeb73c6f47745b2bad32e4a1478.tar.bz2
yuzu-18175c71edf90eeb73c6f47745b2bad32e4a1478.tar.lz
yuzu-18175c71edf90eeb73c6f47745b2bad32e4a1478.tar.xz
yuzu-18175c71edf90eeb73c6f47745b2bad32e4a1478.tar.zst
yuzu-18175c71edf90eeb73c6f47745b2bad32e4a1478.zip
-rw-r--r--src/common/scope_exit.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/common/scope_exit.h b/src/common/scope_exit.h
index fa46cb394..35dac3a8f 100644
--- a/src/common/scope_exit.h
+++ b/src/common/scope_exit.h
@@ -49,3 +49,9 @@ ScopeExitHelper<Func> ScopeExit(Func&& func) {
* \endcode
*/
#define SCOPE_EXIT(body) auto CONCAT2(scope_exit_helper_, __LINE__) = detail::ScopeExit([&]() body)
+
+/**
+ * This macro is similar to SCOPE_EXIT, except the object is caller managed. This is intended to be
+ * used when the caller might want to cancel the ScopeExit.
+ */
+#define SCOPE_GUARD(body) detail::ScopeExit([&]() body)