Synchronize on the class instead of the instance
I didn't realize it before, but it looks like there is at least one instance of YamlRegionFile per world, so synchronizing on the instance wouldn't necessarily help.
This commit is contained in:
parent
7ba0fd3f53
commit
5763f53415
|
@ -192,9 +192,10 @@ public class YamlRegionFile implements RegionDatabase {
|
|||
}
|
||||
|
||||
@Override
|
||||
public synchronized void saveAll(Set<ProtectedRegion> regions) throws StorageException {
|
||||
public void saveAll(Set<ProtectedRegion> regions) throws StorageException {
|
||||
checkNotNull(regions);
|
||||
|
||||
synchronized (YamlRegionFile.class) {
|
||||
File tempFile = new File(file.getParentFile(), file.getName() + ".tmp");
|
||||
YAMLProcessor config = createYamlProcessor(tempFile);
|
||||
|
||||
|
@ -254,6 +255,7 @@ public class YamlRegionFile implements RegionDatabase {
|
|||
throw new StorageException("Failed to rename temporary regions file to " + file.getAbsolutePath());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveChanges(RegionDifference difference) throws DifferenceSaveException {
|
||||
|
|
Loading…
Reference in New Issue