mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2025-01-03 06:57:33 +01:00
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 Set<ProtectedRegion> loadAll(FlagRegistry flagRegistry) throws StorageExc
|
||||
}
|
||||
|
||||
@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 synchronized void saveAll(Set<ProtectedRegion> regions) throws StorageExc
|
||||
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
Block a user