1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-12-24 19:47:58 +01:00

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

View file

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