Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 350092

Summary: Static variables in Environment (and PartEnvironment) may cause problems
Product: z_Archived Reporter: Paul Harmon <pharmon>
Component: EDTAssignee: Justin Spadea <jspadea>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: jspadea
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on:    
Bug Blocks: 350094    

Description Paul Harmon CLA 2011-06-22 15:13:44 EDT
Environment (and PartEnvironment) are currently defined with static variables for INSTANCE and a stack of environments. This could cause problems if the builder is running and any other thread updates the stack of environments.
(such as the WCC or any other tools...such as the test framwork generation code).


One solution to this would be to to change these variables to ThreadSafe. We will need to make sure that the threads that use them do not spawn other threads (or if they do, the current environment should be passed along to the new thread).


A more radical solution would be to synchronize the stack so that once an environment is pushed onto the stack, any other process that attempts to push another environment will need to wait. This would mean that the WCC would not be able to run until a build completely finishes.
Comment 1 Paul Harmon CLA 2011-06-22 15:24:20 EDT
When i said ThreadSafe, I meant ThreadLocal
Comment 2 Justin Spadea CLA 2011-07-06 16:48:29 EDT
Modified Environment and PartEnvironment to use ThreadLocals for their stacks.
Comment 3 Paul Harmon CLA 2011-10-24 08:56:34 EDT
good