mirror of
https://github.com/denoland/deno.git
synced 2025-01-21 21:50:00 -05:00
only use Locker when calling into js (#2665)
This commit is contained in:
parent
042484d45a
commit
621af21e6e
1 changed files with 6 additions and 3 deletions
|
@ -550,9 +550,6 @@ impl Future for Isolate {
|
|||
type Error = ErrBox;
|
||||
|
||||
fn poll(&mut self) -> Poll<(), ErrBox> {
|
||||
// Lock the current thread for V8.
|
||||
let _locker = LockerScope::new(self.libdeno_isolate);
|
||||
|
||||
self.shared_init();
|
||||
|
||||
let mut overflow_response: Option<Buf> = None;
|
||||
|
@ -590,14 +587,20 @@ impl Future for Isolate {
|
|||
}
|
||||
|
||||
if self.shared.size() > 0 {
|
||||
// Lock the current thread for V8.
|
||||
let locker = LockerScope::new(self.libdeno_isolate);
|
||||
self.respond(None)?;
|
||||
// The other side should have shifted off all the messages.
|
||||
assert_eq!(self.shared.size(), 0);
|
||||
drop(locker);
|
||||
}
|
||||
|
||||
if overflow_response.is_some() {
|
||||
// Lock the current thread for V8.
|
||||
let locker = LockerScope::new(self.libdeno_isolate);
|
||||
let buf = overflow_response.take().unwrap();
|
||||
self.respond(Some(&buf))?;
|
||||
drop(locker);
|
||||
}
|
||||
|
||||
self.check_promise_errors();
|
||||
|
|
Loading…
Add table
Reference in a new issue