Closed vikramnitin9 closed 1 year ago
I don't see the problem, running that code I get different addresses, which is what I would expect since deseed.thread
is a cloned RootedThread
. RootedThread
acts like a reference count pointer (think Arc
) so having multiple of them are fine.
Closing but feel free to open if you can demonstrate an issue more clearly.
At this line in the vm,
DeSeed::new
takes a borrow toThread
with an implicit lifetime, and returns a structure with lifetime parameter'gc
.This allows us to create two mutable references to the same thread, as follows :
The lifetime of the borrow to
Thread
should also be'gc
.&'gc Thread
would fix this.