| Summary: | [otre] OTRE doesn't know about all threads | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Tools] Objectteams | Reporter: | Stephan Herrmann <stephan.herrmann> | ||||
| Component: | OTJ | Assignee: | Stephan Herrmann <stephan.herrmann> | ||||
| Status: | VERIFIED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | ||||||
| Version: | 1.4 | ||||||
| Target Milestone: | 0.7 | ||||||
| Hardware: | PC | ||||||
| OS: | Linux | ||||||
| Whiteboard: | trac | ||||||
| Attachments: |
|
||||||
|
Description
Stephan Herrmann
For all threads started before entering main it seems that asking the top-level ThreadGroup for all its active threads would easily allow as to register all known threads at that point. Once all threads are known we can then remove the workarounds regarding the AWT-Event-Thread from class Team (methods deactivate(Thread) and isActive(Thread)) Another thing that bothers me is the use of (new Exception().getStackTrace().length > 3) in TeamThreadManager#newThreadStarted(..) We might get around that by just checking whether the thread is already registered in existingThreads. While we're at it: field Team#_OT$activatedThreads seems to be used inconsistently: Since possible values per thread are TRUE and FALSE, using containsKey(..) looks wrong, should also check the value. Created attachment 172853 [details] proposed fixes This patch implements the following changes: > For all threads started before entering main it seems that asking > the top-level ThreadGroup for all its active threads would easily > allow as to register all known threads at that point. Done. > Once all threads are known we can then remove the workarounds regarding the > AWT-Event-Thread from class Team (methods deactivate(Thread) and > isActive(Thread)) Done. > Another thing that bothers me is the use of > (new Exception().getStackTrace().length > 3) > in TeamThreadManager#newThreadStarted(..) > > We might get around that by just checking whether the thread is already > registered in existingThreads. Done. Still want to look at usage of Team#_OT$activatedThreads (In reply to comment #1) > Another thing that bothers me is the use of > (new Exception().getStackTrace().length > 3) > in TeamThreadManager#newThreadStarted(..) > > We might get around that by just checking whether the thread is already > registered in existingThreads. added test5215_explicitActivationForAllThreads3a() to challenge this part. (In reply to comment #1) > While we're at it: field Team#_OT$activatedThreads > seems to be used inconsistently: Since possible values per thread > are TRUE and FALSE, using containsKey(..) looks wrong, should also > check the value. This was false alarm: the boolean value discriminates explicit vs. implicit activation and is actually used consistently. This closes this issue. Verified using build 201007050931 I used the following scenario to check the issue of the AWT-Event-Queue: Debugging FlightBonus, BP on FlightBonus-ctor, change activate() to activate(ALL_THREADS), but interactively deactivate for current thread. => Globally active except for AWT event thread -> not effective. |