Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 350092 - Static variables in Environment (and PartEnvironment) may cause problems
Summary: Static variables in Environment (and PartEnvironment) may cause problems
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: EDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Justin Spadea CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 350094
  Show dependency tree
 
Reported: 2011-06-22 15:13 EDT by Paul Harmon CLA
Modified: 2017-02-23 14:18 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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