mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[sourcekitd] Fix a race in EditableTextBuffer::getSnapshot()
Found by TSan! This was found while trying to reproduce a test failure on a linux bot while running the test/Misc/stats.swift test. Hopefully this was the underlying issue. rdar://35537968
This commit is contained in:
@@ -126,6 +126,7 @@ EditableTextBuffer::EditableTextBuffer(StringRef Filename, StringRef Text) {
|
||||
}
|
||||
|
||||
ImmutableTextSnapshotRef EditableTextBuffer::getSnapshot() const {
|
||||
llvm::sys::ScopedLock L(EditMtx);
|
||||
return new ImmutableTextSnapshot(const_cast<EditableTextBuffer*>(this), Root,
|
||||
CurrUpd);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user