|
From: <jom...@us...> - 2014-09-03 19:14:57
|
Revision: 1799
http://sourceforge.net/p/jason/svn/1799
Author: jomifred
Date: 2014-09-03 19:14:49 +0000 (Wed, 03 Sep 2014)
Log Message:
-----------
small improvement in sleep/wake
Modified Paths:
--------------
trunk/src/jason/infra/centralised/CentralisedAgArch.java
Modified: trunk/src/jason/infra/centralised/CentralisedAgArch.java
===================================================================
--- trunk/src/jason/infra/centralised/CentralisedAgArch.java 2014-08-28 21:22:45 UTC (rev 1798)
+++ trunk/src/jason/infra/centralised/CentralisedAgArch.java 2014-09-03 19:14:49 UTC (rev 1799)
@@ -210,13 +210,16 @@
}
private Object sleepSync = new Object();
+ private int sleepTime = 50;
public void sleep() {
try {
if (!getTS().getSettings().isSync()) {
logger.fine("Entering in sleep mode....");
synchronized (sleepSync) {
- sleepSync.wait(500); // wait for messages
+ sleepSync.wait(sleepTime); // wait for messages
+ if (sleepTime < 1000)
+ sleepTime += 100;
}
}
} catch (InterruptedException e) {
@@ -227,6 +230,7 @@
public void wake() {
synchronized (sleepSync) {
+ sleepTime = 50;
sleepSync.notifyAll(); // notify sleep method
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|