fixed intermission-bug (removed 'break for intermission' of httpd-thread)

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@1009 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 19 years ago
parent b058ecf0bc
commit 4d1e56e4d9

@ -63,6 +63,7 @@ public abstract class serverAbstractThread extends Thread implements serverThrea
private long threadBlockTimestamp = System.currentTimeMillis(); private long threadBlockTimestamp = System.currentTimeMillis();
private long idleCycles = 0, busyCycles = 0, outofmemoryCycles = 0; private long idleCycles = 0, busyCycles = 0, outofmemoryCycles = 0;
private Object syncObject = null; private Object syncObject = null;
private boolean intermissionObedient = true;
protected final void announceThreadBlockApply() { protected final void announceThreadBlockApply() {
// shall only be used, if a thread blocks for an important reason // shall only be used, if a thread blocks for an important reason
@ -115,6 +116,11 @@ public abstract class serverAbstractThread extends Thread implements serverThrea
memprereq = freeBytes; memprereq = freeBytes;
} }
public void setObeyIntermission(boolean obey) {
// defines if the thread should obey the intermission command
intermissionObedient = obey;
}
public final String getShortDescription() { public final String getShortDescription() {
return this.shortDescr; return this.shortDescr;
} }
@ -237,7 +243,7 @@ public abstract class serverAbstractThread extends Thread implements serverThrea
Runtime rt = Runtime.getRuntime(); Runtime rt = Runtime.getRuntime();
while (running) { while (running) {
if (this.intermission > 0) { if ((this.intermissionObedient) && (this.intermission > 0)) {
long itime = this.intermission - System.currentTimeMillis(); long itime = this.intermission - System.currentTimeMillis();
if (itime > 0) { if (itime > 0) {
logSystem("thread '" + this.getName() + "' breaks for intermission: " + (itime / 1000) + " seconds"); logSystem("thread '" + this.getName() + "' breaks for intermission: " + (itime / 1000) + " seconds");

@ -68,6 +68,9 @@ public interface serverThread {
public void setMemPreReqisite(long freeBytes); public void setMemPreReqisite(long freeBytes);
// sets minimum required amount of memory for the job execution // sets minimum required amount of memory for the job execution
public void setObeyIntermission(boolean obey);
// defines if the thread should obey the intermission command
public String getShortDescription(); public String getShortDescription();
// returns short description string for online display // returns short description string for online display

@ -371,6 +371,7 @@ public final class yacy {
30000 /*command max length incl. GET args*/); 30000 /*command max length incl. GET args*/);
server.setName("httpd:"+port); server.setName("httpd:"+port);
server.setPriority(Thread.MAX_PRIORITY); server.setPriority(Thread.MAX_PRIORITY);
server.setObeyIntermission(false);
if (server == null) { if (server == null) {
serverLog.logSevere("STARTUP", "Failed to start server. Probably port " + port + " already in use."); serverLog.logSevere("STARTUP", "Failed to start server. Probably port " + port + " already in use.");
} else { } else {

Loading…
Cancel
Save