On Tue, Jun 1, 2010 at 10:57 PM, Matt Seegmiller <[email protected]>wrote:

> Were you setting the global context before starting the thread?  Or
> were you setting the global context inside of the thread?  It sounds
> like the former and we're doing the latter.  So I don't think it's the
> same at first blush (though could be related).
>

Sorry, i was unclear: i was GETTING the global context before the thread
started, storing in the "internal data" which gets passed to
pthread_start(), and then getting it (again) from the thread. When i used
(from the thread) Context::GetCurent(), i was getting an empty reference
much of the time (but not always, IIRC).

We're setting the global context via a Context::Scope object just
> before the call to GetPropertyNames in the same thread.  Specifically,
> the function that is calling V8 and crashing looks like:
>

Sorry, i obviously didn't read closely enough - i've never _set_ the global
context, so anything i say on the topic is moot. (In fact, i've never used
more than one context per app.)

i've finally found the code i was looking for:

http://code.google.com/p/v8-juice/source/browse/trunk/src/lib/juice/time.cc

if you'll grep that for "evalFunc" you'll find a note i left to myself about
why that little bastard exists. The reason is because Context::GetCurrent()
was giving me nulls. So i lied earlier - i didn't store the Context handle,
but a handle to the one function from that context's global object which i
needed. Storing the Context should be feasible using that same approach,
though.

-- 
----- stephan beal
http://wanderinghorse.net/home/stephan/

-- 
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users

Reply via email to