Re: Seeing is believing?
On 11/3/2010 7:03 AM, Richard Maher wrote:
Hi Mark,
"markspace"<nospam@nowhere.com> wrote in message
news:iaqbd6$njv$1@news.eternal-september.org...
On 11/2/2010 4:47 PM, Richard Maher wrote:
INFO: In isAuthorized() Thread: thread
applet-tier3Client/Tier3Application.class-2
I don't believe these are the same thread. It's just a name, and you can
name threads all the same if you like.
Print out the object itself and see what you get.
As requested here are the relevant bits: -
basic: PERF: AppletExecutionRunnable - applet.init() BEGIN ; jvmLaunch dt
324932 us, pluginInit dt 51588923 us, TotalTime: 51913855 us
Tier3Client Applet
Version 1.0
Copyright (c) Richard Maher
All rights reserved.
In init() Thread: [thread applet-tier3Client/Tier3Application.class-2]
toString = Thread[thread
applet-tier3Client/Tier3Application.class-2,4,http://192.168.1.159/Applets/-threadGroup]
hash = 180b22e
03/11/2010 9:31:21 PM tier3Client.Tier3Application isAuthorized
INFO: In isAuthorized() Thread: [thread
applet-tier3Client/Tier3Application.class-2] toString = Thread[thread
applet-tier3Client/Tier3Application.class-2,4,http://192.168.1.159/Applets/-threadGroup]
hash = 180b22e
[snip]
Leaving init() Thread: [thread applet-tier3Client/Tier3Application.class-2]
toString = Thread[thread
applet-tier3Client/Tier3Application.class-2,4,http://192.168.1.159/Applets/-threadGroup]
hash = 180b22e
basic: Applet initialized
Do you not see the same thread being used from init() [up until the code
that calls JSObject.getWindow(this)] then isAuthorized receives control of
the very same thread, and when that finishes the rest of init() gets
processed.
So, the problem appears to be that JSObject.getWindow(this) actually
cedes control back to the JS engine parser. Perhaps you should avoid
calling JSObject.getWindow(this) in init().
Is currentThread() stooging me? Is there something there that I don't
understand? Or is it you that won't see what's in front of our faces?
Yes, there is a lot you don't understand, like how to put together an
SSCCE which could show this problem ;-). Anyway, the solution is to
avoid calling getWindow(this) in init(), or at least waiting until the
rest of your initialization is complete.
HTH,
Daniel.
--
Daniel Pitts' Tech Blog: <http://virtualinfinity.net/wordpress/>