rusty_v8
rusty_v8 copied to clipboard
Attempted to implement `Locker` for `Isolate`.
This adds a wrapper SharedIsolate
for OwnedIsolate
(this way all the support code in OwnedIsolate doesn't need to be re-created).
Originally an Unlocker was added as well, but an Unlocker being used inside a Locker
would result in HandleScope instance failing to be created once the Unlocker dropped.
This may be indicating that some part of the Locker api itself isn't working properly with rusty_v8's OwnedIsolate overhead, but the example code does appear to work as expected.
As Unlocker
isn't a direct needed in my use case, it was removed in lue of implementing a bare minimum locker.
I can investigate more into what happened to the unlocker if needed, and there are some open questions about how OwnedIsolate is dropped, where it isn't technically locked, even though drop can only happen on one thread once all lockers have been themselves dropped.
This should partially resolve #643, unlockers and recursive lockers are not part of this proposal.
Turns out there are issues found in CI! I'll poke at that for now.
https://github.com/denoland/rusty_v8/pull/1442 should deal with the construction changes, simplifying this PR.