projects
/
mono.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
896975c
)
Prevent multiple threads to populate the keyword table
author
Jb Evain
<jbevain@gmail.com>
Fri, 7 Jun 2013 19:32:11 +0000
(21:32 +0200)
committer
Jb Evain
<jbevain@gmail.com>
Fri, 7 Jun 2013 21:51:47 +0000
(23:51 +0200)
mcs/class/System/Microsoft.CSharp/CSharpCodeGenerator.cs
patch
|
blob
|
history
diff --git
a/mcs/class/System/Microsoft.CSharp/CSharpCodeGenerator.cs
b/mcs/class/System/Microsoft.CSharp/CSharpCodeGenerator.cs
index e5d9e5e7e669b6fa293eed9d2037467b419084eb..0f8322efc76c4d28f3d0d3573a5448059b630a1e 100644
(file)
--- a/
mcs/class/System/Microsoft.CSharp/CSharpCodeGenerator.cs
+++ b/
mcs/class/System/Microsoft.CSharp/CSharpCodeGenerator.cs
@@
-1597,9
+1597,13
@@
namespace Mono.CSharp
static void FillKeywordTable ()
{
- keywordsTable = new Hashtable ();
- foreach (string keyword in keywords) {
- keywordsTable.Add (keyword, keyword);
+ lock (keywords) {
+ if (keywordsTable == null) {
+ keywordsTable = new Hashtable ();
+ foreach (string keyword in keywords) {
+ keywordsTable.Add (keyword, keyword);
+ }
+ }
}
}