Generate SSD named background thread from typed Jerboa
ober
e95cbc905a7e5e1789a4c97d1ab8dc97895b8c17
--- a/templates/ssd-review.ss +++ b/templates/ssd-review.ss @@ -4892,7 +4892,7 @@ mainActivitySetPositiveRequestDownloadAccess mainActivitySetNegativeCancelAppend mainActivitySetPositiveLoadPage - runBackground mainActivityLogClientEventAsync + runBackground runBackgroundNamed mainActivityLogClientEventAsync mainActivitySetPdfChoiceItems mainActivityPullTruthDumpAsync mainActivityPushTruthDumpAsync @@ -5249,6 +5249,9 @@ (kotlin-member-call addView)) (extern (makeThread (runnable : Runnable)) : Thread (kotlin-call Thread)) + (extern (makeNamedThread (runnable : Runnable) + (name : String)) : Thread + (kotlin-call Thread)) (extern (threadStartRaw (thread : Thread)) : Unit (kotlin-member-call start)) (extern (exceptionMessageRaw (error : Exception)) : (Nullable String) @@ -7123,6 +7126,14 @@ (object Runnable (override (run) : Unit (invoke action)))))) + (def (runBackgroundNamed (name : String) + (action : (-> Unit))) : Unit + (threadStartRaw + (makeNamedThread + (object Runnable + (override (run) : Unit + (invoke action))) + name))) (def (alertDialogBuilderSetPositiveAction (builder : Builder) (text : String) @@ -12446,7 +12457,7 @@ "" " private fun pushTruthAsync(truth: JSONObject) {" " val payload = autosaveTruthPayloadJson(truth).toString()" - " thread(name = \"sfb-truth-autosave\") {" + " runBackgroundNamed(\"sfb-truth-autosave\") {" " try {" " val bytes = textUtf8Bytes(payload)" " require(byteArrayBytesWithinLimit(bytes, MAX_HTTP_TEXT_BYTES)) { \"Autosave payload exceeds byte limit\" }"