We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 25deb99 commit 014c59aCopy full SHA for 014c59a
1 file changed
thread/thread.h
@@ -599,7 +599,7 @@ namespace photon
599
*/
600
#define WITH_LOCK(mutex) if (auto __lock__ = scoped_lock(mutex))
601
602
-#define SCOPE_MAKESURE_YIELD \
603
- uint64_t __swc_##__LINE__ = get_vcpu(photon::CURRENT)->switch_count; \
604
- DEFER(if (__swc_##__LINE__ == get_vcpu(photon::CURRENT)->switch_count) \
605
- photon::thread_yield(););
+#define SCOPE_MAKESURE_YIELD \
+ uint64_t _CONCAT(__swc__, __LINE__) = get_vcpu(photon::CURRENT)->switch_count; \
+ DEFER(({if (_CONCAT(__swc__, __LINE__) == get_vcpu(photon::CURRENT)->switch_count) \
+ photon::thread_yield();}))
0 commit comments