Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 327481 - JavaScriptThread should only suspend if the event thread matches its underlying thread
Summary: JavaScriptThread should only suspend if the event thread matches its underlyi...
Status: RESOLVED FIXED
Alias: None
Product: JSDT
Classification: WebTools
Component: Debug (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.3 M3   Edit
Assignee: Michael Rennie CLA
QA Contact: Simon Kaegi CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 314755
  Show dependency tree
 
Reported: 2010-10-11 14:53 EDT by Michael Rennie CLA
Modified: 2010-10-14 14:43 EDT (History)
3 users (show)

See Also:


Attachments
fix (1.12 KB, patch)
2010-10-11 14:53 EDT, Michael Rennie CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Rennie CLA 2010-10-11 14:53:10 EDT
Created attachment 180614 [details]
fix

code from HEAD

The fix to bug 314755 now has JavaScriptThreads listening to SuspendEvents, which is a good thing. The bad part is that they listen to all SuspendEvents and do no check if the event thread is the same as the underlying thread.

Steps:

1. check out the Crossfire dev client
2. connect to firefox
3. open N tabs
4. suspend Firebug in the browser

Expected:

The matching thread in the Eclipse client would also suspend

Happens:

all threads suspend and the matching thread in the Eclipse client gets its stack frames.

As the fix for 314755 went into 3.2.3 this fix should go in as well. The fix is a simple equals check.
Comment 1 Simon Kaegi CLA 2010-10-11 21:23:41 EDT
I haven't looked at the code yet and will tomorrow but my two initial thoughts were:
1) Should this be handled at a higher level. e.g. why is the thread even receiving this event if it doesn't target the thread. 
2) Do we need to do anything special for a global suspend event.
Comment 2 Michael Rennie CLA 2010-10-12 10:29:54 EDT
(In reply to comment #1)
> I haven't looked at the code yet and will tomorrow but my two initial thoughts
> were:
> 1) Should this be handled at a higher level. e.g. why is the thread even
> receiving this event if it doesn't target the thread. 

We could quite easily handle this case in the event queue, which would require each implementor of the event queue to have such a fix. This fix though is trivial and catches the case that a contributor does not do this check in their event queue.

> 2) Do we need to do anything special for a global suspend event.

Not sure what you mean by the "global suspend" are you referring to the 'suspend for all script loads'?
Comment 3 Michael Rennie CLA 2010-10-14 14:43:12 EDT
I applied the patch to HEAD.

If we want it in any other stream we can clone this bug for those versions.