1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-11-25 15:52:06 +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;
} }