[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.dtp] Re: DTP Init Not Thread Safe

Here is some example code.  I run this within a RCP application and it is run simultaneously within two seperate Jobs.

With the synchronized block this works fine.  Without it it sometimes doesn't.

ProfileManager profileManager = ProfileManager.getInstance();
	        synchronized (profileManager) {
	        	 if (this.profile != null) {
	 	        	profileManager.deleteProfile(this.profile);
	 	        }
	 	        this.profile = profileManager.getProfileByName(profileName);
	 	        if (this.profile == null) {
	 	             this.profile = null;
	        	     profileManager.createProfile(profileName, description, providerId, props);
                       }
           }

I believe the problem lies within the initial Init of the profile manager when you build up all the initial drivers and profiles based off of the DTP extension points.

I am seeing this problem within DTP 1.6 and believe I even saw it within 1.7 but haven't done extensive testing on 1.7