mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 14:42:11 +02:00
[262731] - make access thread safe
This commit is contained in:
parent
233b122712
commit
bc804b6935
1 changed files with 3 additions and 3 deletions
|
@ -19,7 +19,7 @@ public class EnvironmentReader {
|
|||
private static Properties envVars = null;
|
||||
private static ArrayList<String> rawVars = null;
|
||||
|
||||
public static Properties getEnvVars() {
|
||||
public static synchronized Properties getEnvVars() {
|
||||
if (null != envVars) {
|
||||
return (Properties)envVars.clone();
|
||||
}
|
||||
|
@ -41,9 +41,9 @@ public class EnvironmentReader {
|
|||
return p.getProperty(key);
|
||||
}
|
||||
|
||||
public static String[] getRawEnvVars() {
|
||||
public static synchronized String[] getRawEnvVars() {
|
||||
if (rawVars==null)
|
||||
getEnvVars();
|
||||
return rawVars.toArray(new String[0]);
|
||||
return rawVars.toArray(new String[rawVars.size()]);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue