Fix registration

This commit is contained in:
Yota Toyama
2023-09-28 16:06:20 +10:00
parent 44fff26f2f
commit b204c1a6a2

View File

@@ -13,11 +13,15 @@ fn main() {
unsafe { Allocator::initialize() } unsafe { Allocator::initialize() }
let t1 = spawn(|| loop { let t1 = spawn(|| loop {
unsafe { Allocator::register_current_thread().unwrap() }
let ptr = allocate(); let ptr = allocate();
unsafe { *ptr = 0 }; unsafe { *ptr = 0 };
}); });
let t2 = spawn(|| { let t2 = spawn(|| {
unsafe { Allocator::register_current_thread().unwrap() }
let x = allocate(); let x = allocate();
unsafe { *x = 42 }; unsafe { *x = 42 };