remove usage of concurrent ml, deciding that we prefer to run everything in the main thread instead

This commit is contained in:
2025-10-17 23:08:16 +01:00
parent 0799128f7c
commit 111e0cf66d
15 changed files with 43 additions and 134 deletions

View File

@@ -1,6 +1,5 @@
structure GlDraw =
struct
open CML
open DrawMsg
(* The name doesn't make it clear, but this structure

View File

@@ -1,2 +0,0 @@
structure SearchMailbox =
struct open CML val mailbox: SearchMsg.t Mailbox.mbox = Mailbox.mailbox () end

View File

@@ -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

View File

@@ -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 ()

View File

@@ -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