Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Diff of /sml/trunk/src/cm/concur/concur.sml
ViewVC logotype

Diff of /sml/trunk/src/cm/concur/concur.sml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 483, Thu Nov 18 03:30:50 1999 UTC revision 484, Thu Nov 18 08:46:16 1999 UTC
# Line 139  Line 139 
139    
140      fun inputReady iis = let      fun inputReady iis = let
141          val fis = TextIO.getInstream iis          val fis = TextIO.getInstream iis
         val (r, v) = TextIO.StreamIO.getReader fis  
142          fun bad () = (Say.say ["inputReady: bad stream\n"];          fun bad () = (Say.say ["inputReady: bad stream\n"];
143                        raise Fail "concur")                        raise Fail "concur")
144      in          val rv = TextIO.StreamIO.getReader fis
145          case r of          val c = case rv of
146              TextPrimIO.RD { ioDesc = SOME d, ... } =>              (TextPrimIO.RD { ioDesc = SOME d, ... }, "") =>
147                  (case OS.IO.pollDesc d of                  (case OS.IO.pollDesc d of
148                       NONE => bad ()                       NONE => bad ()
149                     | SOME pd => let                     | SOME pd => let
                          val pd = OS.IO.pollIn pd  
                          val fis' = TextIO.StreamIO.mkInstream (r, v)  
150                           val c = ref (Waiting [])                           val c = ref (Waiting [])
151                       in                       in
152                           inputs := (c, pd) :: !inputs;                           inputs := (c, OS.IO.pollIn pd) :: !inputs;
                          TextIO.setInstream (iis, fis');  
153                           c                           c
154                       end)                       end)
155            | _ => bad ()            | (_, "") => bad ()
156              | rv => ref (Arrived ())
157        in
158            TextIO.setInstream (iis, TextIO.StreamIO.mkInstream rv);
159            c
160      end      end
161  end  end

Legend:
Removed from v.483  
changed lines
  Added in v.484

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0