mirror of
https://github.com/2006-Scape/2006Scape.git
synced 2026-07-03 08:39:04 +00:00
Synchronization lock not required for scheduleAtFixedRate(new Runnable(){}) https://stackoverflow.com/a/35498230
This commit is contained in:
@@ -164,8 +164,6 @@ public class GameEngine {
|
||||
*/
|
||||
scheduler.scheduleAtFixedRate(new Runnable() {
|
||||
public void run() {
|
||||
if (lock.tryLock()) {
|
||||
synchronized (lock) {
|
||||
/**
|
||||
* Main Server Tick
|
||||
*/
|
||||
@@ -215,10 +213,6 @@ public class GameEngine {
|
||||
scheduler.shutdown(); // Kills the tickloop thread if Exception is thrown.
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
System.out.println("Can't Keep up! Did the system time change or is the server overloaded?");
|
||||
}
|
||||
}
|
||||
}, 0, GameConstants.CYCLE_TIME, TimeUnit.MILLISECONDS);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user