projects
/
Sone.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Synchronize saving to prevent race conditions while saving.
[Sone.git]
/
src
/
main
/
java
/
net
/
pterodactylus
/
sone
/
core
/
Core.java
diff --git
a/src/main/java/net/pterodactylus/sone/core/Core.java
b/src/main/java/net/pterodactylus/sone/core/Core.java
index
895f570
..
9eba2b7
100644
(file)
--- a/
src/main/java/net/pterodactylus/sone/core/Core.java
+++ b/
src/main/java/net/pterodactylus/sone/core/Core.java
@@
-1117,7
+1117,7
@@
public class Core implements IdentityListener {
* @param sone
* The Sone to save
*/
* @param sone
* The Sone to save
*/
- public void saveSone(Sone sone) {
+ public
synchronized
void saveSone(Sone sone) {
if (!isLocalSone(sone)) {
logger.log(Level.FINE, "Tried to save non-local Sone: %s", sone);
return;
if (!isLocalSone(sone)) {
logger.log(Level.FINE, "Tried to save non-local Sone: %s", sone);
return;
@@
-1409,7
+1409,7
@@
public class Core implements IdentityListener {
/**
* Saves the current options.
*/
/**
* Saves the current options.
*/
- public void saveConfiguration() {
+ public
synchronized
void saveConfiguration() {
/* store the options first. */
try {
configuration.getIntValue("Option/InsertionDelay").setValue(options.getIntegerOption("InsertionDelay").getReal());
/* store the options first. */
try {
configuration.getIntValue("Option/InsertionDelay").setValue(options.getIntegerOption("InsertionDelay").getReal());