diff --git a/test/emu/common/instr.h b/test/emu/common/instr.h index f5c0d52..0e58fc0 100644 --- a/test/emu/common/instr.h +++ b/test/emu/common/instr.h @@ -62,6 +62,8 @@ int64_t get_delta(void); } INSTR_3ARG(instr_thread_execute, "OHx", int32_t, cpu, int32_t, creator_tid, uint64_t, tag) +INSTR_0ARG(instr_thread_pause, "OHp") +INSTR_0ARG(instr_thread_resume, "OHr") INSTR_1ARG(instr_thread_affinity_set, "OAs", int32_t, cpu) static inline void diff --git a/test/emu/ovni/libovni-mark.c b/test/emu/ovni/libovni-mark.c index 8c1387b..56af5a2 100644 --- a/test/emu/ovni/libovni-mark.c +++ b/test/emu/ovni/libovni-mark.c @@ -51,9 +51,16 @@ main(void) int which = 1 + (rand() % 3); + /* Simulate a thread goes to sleep */ + if (rank == 0 && i == 25) + instr_thread_pause(); + ovni_mark_push(MARK_COLORS, which); rand_sleep(500); ovni_mark_pop(MARK_COLORS, which); + + if (rank == 0 && i == 75) + instr_thread_resume(); } ovni_mark_set(MARK_PROGRESS, 100);