You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the closure passed into thunk::unsync::Thunk panics, then evaluate_thunk will leave self in the Cache { evaluating: () } state, while the flag is still set to Deferred.
This is partially correctly prohibited by Thunk containing an UnsafeCell and not implementing std::panic::RefUnwindSafe.
However, if thunk::unsync::Thunk implemented poisoning, then it could become RefUnwindSafe and be used in situations where std::panic::catch_unwind is useful. I think this would just look like setting the flag to some Flag::Poisoned directly before running the closure, right after line 168. Then if Poisoned is encountered, it could just panic with a message "thunk poisoned"?
The text was updated successfully, but these errors were encountered:
If the closure passed into
thunk::unsync::Thunk
panics, thenevaluate_thunk
will leaveself
in theCache { evaluating: () }
state, while the flag is still set toDeferred
.This is partially correctly prohibited by
Thunk
containing anUnsafeCell
and not implementingstd::panic::RefUnwindSafe
.However, if
thunk::unsync::Thunk
implemented poisoning, then it could becomeRefUnwindSafe
and be used in situations wherestd::panic::catch_unwind
is useful. I think this would just look like setting the flag to someFlag::Poisoned
directly before running the closure, right after line 168. Then if Poisoned is encountered, it could just panic with a message "thunk poisoned"?The text was updated successfully, but these errors were encountered: