Skip to content

Commit

Permalink
Synchronize on SymbolTable info
Browse files Browse the repository at this point in the history
  • Loading branch information
olafurpg committed Apr 9, 2018
1 parent c96b364 commit 8a3f9a0
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@ class LazySymbolTable(mclasspath: Classpath) extends SymbolTable {
// Map from symbols to the paths to their corresponding semanticdb file where they are stored.
private val notYetLoadedSymbols = TrieMap.empty[String, SemanticdbEntry]
private val loadedSymbols = TrieMap.empty[String, s.SymbolInformation]
val lock = new Object

mclasspath.shallow.foreach(loadSemanticdbIndex)

override def info(symbol: String): Option[s.SymbolInformation] = {
override def info(symbol: String): Option[s.SymbolInformation] = lock.synchronized {
var result = loadedSymbols.get(symbol)
if (result.isEmpty) {
loadSymbolFromClasspath(symbol)
Expand Down

0 comments on commit 8a3f9a0

Please sign in to comment.