> I don't see the possibility of a deadlock, there is only one lock required (and nobody else uses the instance lock). 

You are right on our codebase, but you can't possibly know in general. The risk is there, whether it is exploited or not it's a different question.

> I could use the _sourceFile lock if you prefer, but I think that opens up the possibility of future deadlocks (since you can grab the instance lock and need the _sourceFile lock, or vice-versa).

I don't think we should use that either, because the ``SourceFile`` instance is returned, basically leading to most of the same issues described for using the ``ScalaCompilationUnit`` instance. I would use an additional ``sourceFileLock`` object.