From 7ea66fe6967e5dd7f1066389564aad185cd21b7b Mon Sep 17 00:00:00 2001 From: Tim Besard Date: Wed, 21 Oct 2026 14:28:14 +0200 Subject: [PATCH] Build the thread ID buffer of wait workers concretely `ntuple` with a literal count above 10 returns a tuple of unknown length, which was then converted to `NTuple{32, UInt8}` with generic methods (`ntuple` over a `Val` of unknown type, comparisons with `Any`) that packages like ForwardDiff invalidate. When such a package was loaded first, that discarded the precompiled code that starts wait workers in packages using GPUToolbox. --- src/synchronization.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/synchronization.jl b/src/synchronization.jl index 06df26e..cb89b62 100644 --- a/src/synchronization.jl +++ b/src/synchronization.jl @@ -136,7 +136,7 @@ function create_wait_worker(overflow::Bool) started = false try # we don't know what the size of uv_thread_t is, so reserve enough space - tid = Ref{NTuple{32, UInt8}}(ntuple(i -> 0, 32)) + tid = Ref{NTuple{32, UInt8}}(ntuple(i -> 0x00, Val(32))) cb = @cfunction(wait_worker_loop, Cvoid, (Ptr{Cvoid},)) err = ccall(:uv_thread_create, Cint, (Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cvoid}),