This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: display vs write


* Per Bothner [2012-02-03 20:10] writes:

> What I would do first is change (1) so the the repl code
> creates a vanilla java.lang.Thread, rather than a future.
> That fixes the immediate problem, and I think makes sense.

Here is a patch to do that.  I also made serve return the new thread
which might be useful and doesn't seem to hurt.

Helmut

Index: TelnetRepl.java
===================================================================
--- TelnetRepl.java	(revision 7157)
+++ TelnetRepl.java	(working copy)
@@ -40,7 +40,7 @@
       @param client A client that has connected to us,
       and that wants to use the telnet protocol to talk to a
       Scheme read-eval-print-loop. */
-  public static void serve (Language language, java.net.Socket client)
+  public static Thread serve (Language language, java.net.Socket client)
     throws java.io.IOException
   {
     Telnet conn = new Telnet(client, true);
@@ -55,9 +55,11 @@
     conn.request(Telnet.DO, Telnet.LINEMODE);
     */
 
-    Thread thread = new Future(new TelnetRepl(language, client),
-			       in, out, out);
+    Runnable r = new RunnableClosure(new TelnetRepl(language, client),
+				     in, out, out);
+    Thread thread = new Thread(r);
     thread.start();
+    return thread;
   }
 }
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]