summaryrefslogtreecommitdiffstats
path: root/platforms/synchronization_util.h
diff options
context:
space:
mode:
authorlokher <lokher@gmail.com>2023-04-26 16:32:15 +0800
committerlokher <lokher@gmail.com>2023-04-26 16:32:15 +0800
commite4f4ceaf3f2e3d25fb282273a81f9b58790fc427 (patch)
treec0a257eab0ffe5238fdf2c04882e8ee1fe8fc46e /platforms/synchronization_util.h
parent103badc87cb50db1ff3851c84331e86ba78fb681 (diff)
merge upstream 713427c
Diffstat (limited to 'platforms/synchronization_util.h')
-rw-r--r--platforms/synchronization_util.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/platforms/synchronization_util.h b/platforms/synchronization_util.h
index 59933945c3..4969eff478 100644
--- a/platforms/synchronization_util.h
+++ b/platforms/synchronization_util.h
@@ -29,6 +29,12 @@ inline void split_shared_memory_unlock(void){};
prefix##_unlock(); \
}
+/* Generate an out-of-line implementation in case the inline functions defined
+ * by the above macro don't actually get inlined. */
+#define QMK_IMPLEMENT_AUTOUNLOCK_HELPERS(prefix) \
+ extern inline unsigned prefix##_autounlock_lock_helper(void); \
+ extern inline void prefix##_autounlock_unlock_helper(unsigned* unused_guard);
+
/* Convinience macro the automatically generate the correct RAII-style
* lock_autounlock function macro */
#define QMK_DECLARE_AUTOUNLOCK_CALL(prefix) unsigned prefix##_guard __attribute__((unused, cleanup(prefix##_autounlock_unlock_helper))) = prefix##_autounlock_lock_helper