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:
parent
f27cb8ac73
commit
9f89b0d29b
1 changed files with 8 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue