addr stuff (?)

This commit is contained in:
Jaremy Creechley 2023-09-18 13:30:22 -07:00
parent d2a8a72a7d
commit 1a4b9076b3
No known key found for this signature in database
GPG Key ID: 4E66FB67B21D3300
2 changed files with 4 additions and 6 deletions

View File

@ -35,12 +35,12 @@ type
ThreadResult[T: ThreadTypes] = Result[T, DataBuffer]
TaskCtx[T: ThreadTypes] = ref object
ds: ptr Datastore
res: ThreadResult[T]
ds*: ptr Datastore
res*: ThreadResult[T]
cancelled: Atomic[bool]
isActive: Atomic[bool]
semaphore: AsyncSemaphore
signal: ThreadSignalPtr
signal*: ThreadSignalPtr
ThreadDatastore* = ref object of Datastore
tp: Taskpool

View File

@ -146,13 +146,11 @@ suite "Test ThreadDatastore cancelations":
test "Should monitor signal and cancel":
var
signal = ThreadSignalPtr.new().tryGet()
res = ThreadResult[void]()
ctx = TaskCtx[void](
ds: addr sqlStore,
res: addr res,
signal: signal)
fut = newFuture[void]("signalMonitor")
threadArgs = (addr ctx, addr fut)
threadArgs: (ptr TaskCtx, ptr Future[void]) = (unsafeAddr ctx[], addr fut)
var
thread: Thread[type threadArgs]