From 027b63bde65abc7a7400cbcc05e7f520489d5064 Mon Sep 17 00:00:00 2001 From: hns Date: Tue, 19 Mar 2002 19:35:40 +0000 Subject: [PATCH] Run endless loop in separate new thread, otherwise the server field will never be assigned the Server object (because the Server constructor never returns, because the calling thread ends up in the loop checking for updates in apps.properties). --- src/helma/main/Server.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/helma/main/Server.java b/src/helma/main/Server.java index 0dfaf7cd..170f3343 100644 --- a/src/helma/main/Server.java +++ b/src/helma/main/Server.java @@ -22,7 +22,7 @@ import com.sleepycat.db.*; * Helma server main class. */ - public class Server implements IPathElement { + public class Server implements IPathElement, Runnable { public static final String version = "1.2pre2 2002/03/07"; public static final long starttime = System.currentTimeMillis(); @@ -48,7 +48,7 @@ import com.sleepycat.db.*; static Hashtable dbSources; - static Server server; + private static Server server; protected static File hopHome = null; @@ -111,7 +111,6 @@ import com.sleepycat.db.*; } server = new Server (homeDir); - } public Server (String home) { @@ -186,8 +185,8 @@ import com.sleepycat.db.*; // Start running, finishing setup and then entering a loop to check changes // in the apps.properties file. - mainThread = Thread.currentThread (); - run (); + mainThread = new Thread (this); + mainThread.start (); } /**