Ensure channels don't leak exception effects (#25318)

The forward declarations cause `Exception` to be inferred - also,
`llrecv` is an internal implementation detail and the type of the
received item is controlled by generics, thus the ValueError raised
there seems out of place for the generic api.

(cherry picked from commit 91febf1f4c)
This commit is contained in:
Jacek Sieka
2025-12-01 22:59:26 +01:00
committed by narimiran
parent 800384176e
commit 75f01bd49f
13 changed files with 64 additions and 45 deletions

View File

@@ -12,14 +12,14 @@ var
chan1.open()
chan2.open()
proc routeMessage*(msg: BackendMessage) =
proc routeMessage*(msg: BackendMessage) {.raises: [], gcsafe.} = # no exceptions!
discard chan2.trySend(msg)
var
recv: Thread[void]
stopToken: Atomic[bool]
proc recvMsg() =
proc recvMsg() {.raises: [], gcsafe.} = # no exceptions!
while not stopToken.load(moRelaxed):
let resp = chan1.tryRecv()
if resp.dataAvailable: