@@ -122,7 +122,7 @@ local threading_thread = {}
122122--- @overload fun < R> (self : threading.thread<R> , timeout : number ): true , R , ...
123123--- @overload fun < R> (self : threading.thread<R> , timeout : number ): false , any
124124--- @overload fun < R> (self : threading.thread<R> , timeout : number ): nil , threading.timeout_error
125- --- @param timeout ? number seconds to wait ; omit to block indefinitely .
125+ --- @param timeout number seconds to wait when supplied .
126126--- @return threading.join_status ok true for child success , false for child error , nil on timeout.
127127--- @return ... child results , an error object , or the timeout reason.
128128function threading_thread :join (timeout ) end
@@ -173,8 +173,8 @@ local threading_channel = {}
173173--- @overload fun ( self : threading.channel<T> , value : T , timeout : number ): nil , threading.timeout_error
174174--- @param self threading.channel<T>
175175--- @param value T
176- --- @param timeout ? number seconds to wait ; omit to block indefinitely .
177- --- @return true | nil ok true on success, nil on timeout.
176+ --- @param timeout number seconds to wait when supplied .
177+ --- @return threading.send_result ok true on success, nil on timeout.
178178--- @return threading.timeout_error ? err timeout reason when ` ok` is nil.
179179function threading_channel :send (value , timeout ) end
180180
@@ -189,7 +189,7 @@ function threading_channel:send(value, timeout) end
189189--- @overload fun ( self : threading.channel<T> , timeout : number ): nil , false
190190--- @overload fun ( self : threading.channel<T> , timeout : number ): nil , threading.timeout_error
191191--- @param self threading.channel<T>
192- --- @param timeout ? number seconds to wait ; omit to block indefinitely .
192+ --- @param timeout number seconds to wait when supplied .
193193--- @return T | nil value
194194--- @return threading.recv_status status
195195function threading_channel :recv (timeout ) end
@@ -231,7 +231,8 @@ function threading.now() end
231231function threading .fence () end
232232
233233--- @overload fun (): nil
234- --- @param seconds ? number seconds to sleep ; omit to sleep for 0 seconds.
234+ --- @overload fun ( seconds : number ): nil
235+ --- @param seconds number seconds to sleep when supplied.
235236--- @return nil
236237function threading .sleep (seconds ) end
237238
@@ -241,11 +242,17 @@ function threading.sleep(seconds) end
241242function threading .gcstats () end
242243
243244--- Query or set the number of parked GC2 worker threads.
245+ --- @overload fun (): integer
246+ --- @overload fun ( count : nil ): integer
247+ --- @overload fun ( count : integer ): integer
244248--- @param count ? integer | nil nil queries without changing the worker count.
245249--- @return integer old_count
246250function threading .gcworkers (count ) end
247251
248252--- Query or set the GC2 collection mode.
253+ --- @overload fun (): threading.gcmode
254+ --- @overload fun ( mode : nil ): threading.gcmode
255+ --- @overload fun ( mode : threading.gcmode ): threading.gcmode
249256--- @param mode ? threading.gcmode | nil nil queries without changing the mode.
250257--- @return threading.gcmode old_mode
251258function threading .gcmode (mode ) end
@@ -271,7 +278,7 @@ function threading.mutex() end
271278--- requested capacity.
272279--- @overload fun (): threading.channel<any>
273280--- @overload fun ( capacity : integer ): threading.channel<any>
274- --- @param capacity ? integer buffered slot count ; omit for a rendezvous channel .
281+ --- @param capacity integer buffered slot count when supplied .
275282--- @return threading.channel<any> channel
276283function threading .channel (capacity ) end
277284
0 commit comments