Remove unnecessary synchronization in SmackReater.schedule()

The DelayQueue 'scheduledActions' is already thread-safe.
This commit is contained in:
Florian Schmaus 2019-06-03 09:27:28 +02:00
parent 619b8e6f4a
commit 027cae3bd0
1 changed files with 1 additions and 3 deletions

View File

@ -149,9 +149,7 @@ public class SmackReactor {
long releaseTimeEpoch = System.currentTimeMillis() + unit.toMillis(delay);
Date releaseTimeDate = new Date(releaseTimeEpoch);
ScheduledAction scheduledAction = new ScheduledAction(runnable, releaseTimeDate, this);
synchronized (scheduledActions) {
scheduledActions.add(scheduledAction);
}
scheduledActions.add(scheduledAction);
return scheduledAction;
}