Skip to content

Commit 2829d33

Browse files
committed
Fence before handle invalidation
1 parent faa74e6 commit 2829d33

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

runtime/include/alaska/alaska.hpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,9 @@ namespace alaska {
7777

7878
inline void invalidate(void) {
7979
#ifdef __riscv
80-
__asm__ volatile("csrw 0xc4, %0" ::"rK"((uint64_t)handle_id()) : "memory");
80+
// Fence *before* the handle invalidation.
8181
__asm__ volatile("fence" ::: "memory");
82+
__asm__ volatile("csrw 0xc4, %0" ::"rK"((uint64_t)handle_id()) : "memory");
8283
#endif
8384
}
8485

0 commit comments

Comments
 (0)