提交 621af21e 编写于 作者: A andy finch 提交者: Ryan Dahl

only use Locker when calling into js (#2665)

上级 042484d4
......@@ -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();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册