aboutsummaryrefslogtreecommitdiff
path: root/lib/std/Thread
AgeCommit message (Collapse)Author
2025-10-31std.os.windows: eliminate forwarder function in kernel32 (#25766)qilme
#1840 kernel32.AddVectoredExceptionHandler -> ntdll.RtlAddVectoredExceptionHandler kernel32.RemoveVectoredExceptionHandler -> ntdll.RtlRemoveVectoredExceptionHandler kernel32.ExitProcess -> ntdll.RtlExitUserProcess kernel32.InitializeCriticalSection -> ntdll.RtlInitializeCriticalSection kernel32.EnterCriticalSection -> ntdll.RtlEnterCriticalSection kernel32.LeaveCriticalSection -> ntdll.RtlLeaveCriticalSection kernel32.DeleteCriticalSection -> ntdll.RtlDeleteCriticalSection kernel32.TryAcquireSRWLockExclusive -> ntdll.RtlTryAcquireSRWLockExclusive kernel32.AcquireSRWLockExclusive -> ntdll.RtlAcquireSRWLockExclusive kernel32.ReleaseSRWLockExclusive -> ntdll.RtlReleaseSRWLockExclusive kernel32.WakeConditionVariable -> ntdll.RtlWakeConditionVariable kernel32.WakeAllConditionVariable -> ntdll.RtlWakeAllConditionVariable kernel32.HeapReAlloc -> ntdll.RtlReAllocateHeap kernel32.HeapAlloc -> ntdll.RtlAllocateHeap
2025-10-30Merge pull request #25763 from mrjbq7/cancelledJohn Benediktsson
rename Cancelled to Canceled
2025-10-29fix miscellaneous compilation failuresAndrew Kelley
2025-10-29std.Io: implement dirStatPathAndrew Kelley
2025-10-29std.Thread.ResetEvent: make it more reusableAndrew Kelley
2025-10-29revert std.Thread.Pool for nowAndrew Kelley
and move the Io impl to a separate file
2025-10-29update to sync with masterAndrew Kelley
2025-10-29std.Io.EventLoop: implement selectAndrew Kelley
2025-10-29introduce Io.select and implement it in thread poolAndrew Kelley
2025-10-29Io.Condition: implement full APIJacob Young
2025-10-29std.Io.Condition: change primitive to support only oneAndrew Kelley
and no timer
2025-10-29Io: implement faster mutexJacob Young
2025-10-29std.Io: add detached asyncAndrew Kelley
2025-10-29implement Mutex, Condition, and QueueAndrew Kelley
2025-10-29Io: implement sleep and fix cancel bugsJacob Young
2025-10-29EventLoop: implement thread-local queues and cancellationJacob Young
2025-10-29std.Io: introduce cancellationAndrew Kelley
2025-10-29start adding fs functions to std.IoAndrew Kelley
2025-10-29free freeing wrong amount in thread pool implAndrew Kelley
2025-10-29fix context passing in threaded Io implAndrew Kelley
2025-10-29make thread pool satisfy async/await interfaceAndrew Kelley
2025-10-29introduce std.Io interfaceAndrew Kelley
which is planned to have all I/O operations in the interface, but for now has only async and await.
2025-10-18std: make RwLock test less intensivemlugg
This test called `yield` 80,000 times, which is nothing on a system with little load, but murder on a CI system. macOS' scheduler in particular doesn't seem to deal with this very well. The `yield` calls also weren't even necessarily doing what they were meant to: if the optimizer could figure out that it doesn't clobber some memory, then it could happily reorder around the `yield`s anyway! The test has been simplified and made to work better, and the number of yields have been reduced. The number of overall iterations has also been reduced, because with the `yield` calls making races very likely, we don't really need to run too many iterations to be confident that the implementation is race-free.
2025-10-18tweak tests to avoid timeoutsmlugg
2025-07-11Remove numerous things deprecated during the 0.14 release cycleLinus Groh
Basically everything that has a direct replacement or no uses left. Notable omissions: - std.ArrayHashMap: Too much fallout, needs a separate cleanup. - std.debug.runtime_safety: Too much fallout. - std.heap.GeneralPurposeAllocator: Lots of references to it remain, not a simple find and replace as "debug allocator" is not equivalent to "general purpose allocator". - std.io.Reader: Is being reworked at the moment. - std.unicode.utf8Decode(): No replacement, needs a new API first. - Manifest backwards compat options: Removal would break test data used by TestFetchBuilder. - panic handler needs to be a namespace: Many tests still rely on it being a function, needs a separate cleanup.
2025-06-17linux: futex v1 API cleanupPat Tullmann
* Use `packed struct` for flags arguments. So, instead of `linux.FUTEX.WAIT` use `.{ .cmd = .WAIT, .private = true }` * rename `futex_wait` and `futex_wake` which didn't actually specify wait/wake, as `futex_3arg` and `futex_4arg` (as its the number of parameters that is different, the `op` is whatever is specified. * expose the full six-arg flavor of the syscall (for some of the advanced ops), and add packed structs for their arguments. * Use a `packed union` to support the 4th parameter which is sometimes a `timespec` pointer, and sometimes a `u32`. * Add tests that make sure the structure layout is correct and that the basic argument passing is working (no actual futexes are contended).
2025-06-05std.Target: Introduce Cpu convenience functions for feature tests.Alex Rønne Petersen
Before: * std.Target.arm.featureSetHas(target.cpu.features, .has_v7) * std.Target.x86.featureSetHasAny(target.cpu.features, .{ .sse, .avx, .cmov }) * std.Target.wasm.featureSetHasAll(target.cpu.features, .{ .atomics, .bulk_memory }) After: * target.cpu.has(.arm, .has_v7) * target.cpu.hasAny(.x86, &.{ .sse, .avx, .cmov }) * target.cpu.hasAll(.wasm, &.{ .atomics, .bulk_memory })
2025-04-03de-genericify SinglyLinkedListAndrew Kelley
by making it always intrusive, we make it a more broadly useful API, and avoid binary bloat.
2025-02-17std.Target: Remove functions that just wrap component functions.Alex Rønne Petersen
Functions like isMinGW() and isGnuLibC() have a good reason to exist: They look at multiple components of the target. But functions like isWasm(), isDarwin(), isGnu(), etc only exist to save 4-8 characters. I don't think this is a good enough reason to keep them, especially given that: * It's not immediately obvious to a reader whether target.isDarwin() means the same thing as target.os.tag.isDarwin() precisely because isMinGW() and similar functions *do* look at multiple components. * It's not clear where we would draw the line. The logical conclusion before this commit would be to also wrap Arch.isX86(), Os.Tag.isSolarish(), Abi.isOpenHarmony(), etc... this obviously quickly gets out of hand. * It's nice to just have a single correct way of doing something.
2025-02-01std.posix: Use separate clock ID enums for clock_gettime() and ↵Chris Boesch
timerfd_create() (#22627)
2025-01-16x86_64: fix crashes compiling the compiler and testsJacob Young
2025-01-16x86_64: implement switch jump tablesJacob Young
2024-11-27std.Thread.Futex: Mark inline asm volatile in WasmImpl.Alex Rønne Petersen
Closes #22082.
2024-11-11Revert "Enable thread_pool function to throw errors (#20260)"Andrew Kelley
This reverts commit d346d074ebe5347f730a70d3a88b12f279bb405d. I would like a chance to review this, please.
2024-11-11Enable thread_pool function to throw errors (#20260)ippsav
* std.ThreadPool: allow error union return type * allow noreturn in Pool.zig
2024-10-23combine codegen work queue and linker task queueAndrew Kelley
these tasks have some shared data dependencies so they cannot be done simultaneously. Future work should untangle these data dependencies so that more can be done in parallel. for now this commit ensures correctness by making linker input parsing and codegen tasks part of the same queue.
2024-10-04remove `@fence` (#21585)David Rubin
closes #11650
2024-09-11thread: don't leak the thread in `spawnManager` (#21379)David Rubin
2024-08-27compiler,lib,test,langref: migrate `@setCold` to `@branchHint`mlugg
2024-07-19std.c reorganizationAndrew Kelley
It is now composed of these main sections: * Declarations that are shared among all operating systems. * Declarations that have the same name, but different type signatures depending on the operating system. Often multiple operating systems share the same type signatures however. * Declarations that are specific to a single operating system. - These are imported one per line so you can see where they come from, protected by a comptime block to prevent accessing the wrong one. Closes #19352 by changing the convention to making types `void` and functions `{}`, so that it becomes possible to update `@hasDecl` sites to use `@TypeOf(f) != void` or `T != void`. Happily, this ended up removing some duplicate logic and update some bitrotted feature detection checks. A handful of types have been modified to gain namespacing and type safety. This is a breaking change. Oh, and the last usage of `usingnamespace` site is eliminated.
2024-07-15Better implementation of GetLastError. (#20623)Lucas Santos
Instead of calling the dynamically loaded kernel32.GetLastError, we can extract it from the TEB. As shown by [Wine](https://github.com/wine-mirror/wine/blob/34b1606019982b71818780bc84b76460f650af31/include/winternl.h#L439), the last error lives at offset 0x34 of the TEB in 32-bit Windows and at offset 0x68 in 64-bit Windows.
2024-07-09test: Add `spawn` behavior testmochalins
2024-07-09fix: Update `spawn`'s' `runFn` signaturemochalins
2024-07-08Compilation: put supported codegen backends on a separate threadJacob Young
(There are no supported backends.)
2024-07-07InternPool: implement and use thread-safe list for extra and limbsJacob Young
2024-07-07InternPool: temporarily disable multi-threaded behaviorJacob Young
This reduces the cost of the new data structure until the multi-threaded behavior is actually used.
2024-07-07InternPool: implement thread-safe hash mapJacob Young
2024-07-07Zcu: introduce `PerThread` and pass to all the functionsJacob Young
2024-06-12std.Thread.Mutex.Recursive: alternate implementationAndrew Kelley
This version is simpler. Thanks King!
2024-06-12introduce std.Thread.Mutex.RecursiveAndrew Kelley