1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

Adapt the queue test to be architecture-agnostic

Signed-off-by: Leonardo Carreras <leonardo.carreras@eonerc.rwth-aachen.de>
This commit is contained in:
Leonardo Carreras 2025-02-03 16:43:42 +00:00
parent f27cb8ac73
commit 9f89b0d29b

View file

@ -62,8 +62,14 @@ uint64_t thread_get_id() {
return -1;
}
// Sleep, do nothing
__attribute__((always_inline)) static inline void nop() { __asm__("rep nop;"); }
// Sleep, do nothing (Architecture-Specific)
__attribute__((always_inline)) static inline void nop() {
#if defined(__aarch64__)
__asm__ volatile("yield"); /// ARM equivalent of rep nop.
#else
__asm__ volatile("rep nop"); /// x86 and most other architectures use rep nop.
#endif
}
static void *producer(void *ctx) {
int ret;