remove usage of concurrent ml, deciding that we prefer to run everything in the main thread instead
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
structure GlDraw =
|
||||
struct
|
||||
open CML
|
||||
open DrawMsg
|
||||
|
||||
(* The name doesn't make it clear, but this structure
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
structure SearchMailbox =
|
||||
struct open CML val mailbox: SearchMsg.t Mailbox.mbox = Mailbox.mailbox () end
|
||||
@@ -1,16 +0,0 @@
|
||||
structure SearchThread =
|
||||
struct
|
||||
open CML
|
||||
|
||||
fun loop () =
|
||||
let
|
||||
val (buffer, dfa, time) = Mailbox.recv SearchMailbox.mailbox
|
||||
val iterator = LineGap.makeStringIterator buffer
|
||||
val searchList = SearchList.build (iterator, dfa)
|
||||
handle e => ExceptionLogger.log e
|
||||
val msg = InputMsg.WITH_SEARCH_LIST (searchList, time)
|
||||
val () = InputMailbox.append msg
|
||||
in
|
||||
loop ()
|
||||
end
|
||||
end
|
||||
@@ -88,12 +88,9 @@ struct
|
||||
val app = AppType.init (lineGap, 1920, 1080, Time.now ())
|
||||
|
||||
val () = registerCallbacks window
|
||||
|
||||
val _ = CML.spawn (fn () => GlDraw.loop (app, window))
|
||||
val _ = CML.spawn SearchThread.loop
|
||||
in
|
||||
()
|
||||
GlDraw.loop (app, window)
|
||||
end
|
||||
end
|
||||
|
||||
val _ = RunCML.doit (Shell.main, SOME (Time.fromMicroseconds 555))
|
||||
val () = Shell.main ()
|
||||
|
||||
@@ -4,10 +4,7 @@ struct
|
||||
open InputMsg
|
||||
|
||||
fun sendMsg msg =
|
||||
case msg of
|
||||
DRAW msg => DrawMailbox.append msg
|
||||
| SEARCH (buffer, searchString, time) =>
|
||||
Mailbox.send (SearchMailbox.mailbox, (buffer, searchString, time))
|
||||
case msg of DRAW msg => DrawMailbox.append msg
|
||||
|
||||
fun sendMsgs msgList =
|
||||
case msgList of
|
||||
|
||||
Reference in New Issue
Block a user