The problem with Enter() is that if you're already Entered, now you're in
there twice. So if it's a patchwork solution that checks if the MyIsolate
!= Isolate::GetCurrent, and then calls MyIsolate->Enter(), I could started
entering an unknown number of times (I may already be entered, just not the
"current one"). This blows up later on when you try to Dispose() the
isolate. Of course I could track the number of times I performed this
patchwork solution, and before Dispose is called, I could call Exit() that
number of times, but now were really getting hacky.

I was hoping for an easy way to tell V8 that "this isolate" is the current,
without any side effects.

On Fri, 28 Jul 2017 at 12:28 Zac Hansen <xax...@gmail.com> wrote:

> This is just a guess, but does v8::Isolate::Enter do it?
>
>
> https://v8.paulfryzel.com/docs/master/classv8_1_1_isolate.html#aec80bb49b6b7647ff75e8f2cc9484ea3
>
>
>
> On Friday, July 28, 2017 at 11:56:16 AM UTC-7, Ian Bull wrote:
>>
>> I know Isolate::GetCurrent is deprecated, but it's still being used
>> inside V8 itself in places, and there are times when it's getting the wrong
>> isolate. [1] for example.
>>
>> [1] String::Value::Value(v8::Local<v8::Value> obj) : str_(NULL),
>> length_(0)  // in api.cc
>>
>> I created Isolate A, and inside a callback, I create some new Isolates,
>> Lock and Unlock. Then when I return from the callback, the
>> Isolate::GetCurrent no longer points to Isolate A, and in some cases points
>> to null. I am always tracking which Isolate I'm using, and it's pretty easy
>> to detect that the wrong "current isolate" is set. Is there a way to tell
>> V8 that Isolate::GetCurrent should now point to a particular Isolate?
>>
>> Cheers,
>> Ian
>>
> --
> --
> v8-users mailing list
> v8-users@googlegroups.com
> http://groups.google.com/group/v8-users
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "v8-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/v8-users/5j2V8ex6pdA/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> v8-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
"v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to