aboutsummaryrefslogtreecommitdiff
path: root/lib/std/Thread.zig
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-29std.Io.Threaded: add ioBasic which disables networkingAndrew Kelley
2025-10-29std: back out the StackTrace byval changesAndrew Kelley
Let's keep passing this thing by pointer
2025-10-29std: fix compilation errors on WindowsAndrew Kelley
2025-10-29std.fs: use BadPathName rather than InvalidWtf8 on WindowsAndrew Kelley
2025-10-29std.Io: implement dirStatPathAndrew Kelley
2025-10-29WIP: hack at std.Io on a planeAndrew Kelley
2025-10-29WIP land the std.Io interfaceAndrew Kelley
fix std lib compilation errors caused by introducing std.Io
2025-10-29std.Thread.ResetEvent: make it more reusableAndrew Kelley
2025-10-29std.Io: add asyncConcurrent and asyncParallelAndrew Kelley
2025-10-27remove all Oracle Solaris supportAlex Rønne Petersen
There is no straightforward way for the Zig team to access the Solaris system headers; to do this, one has to create an Oracle account, accept their EULA to download the installer ISO, and finally install it on a machine or VM. We do not have to jump through hoops like this for any other OS that we support, and no one on the team has expressed willingness to do it. As a result, we cannot audit any Solaris contributions to std.c or other similarly sensitive parts of the standard library. The best we would be able to do is assume that Solaris and illumos are 100% compatible with no way to verify that assumption. But at that point, the solaris and illumos OS tags would be functionally identical anyway. For Solaris especially, any contributions that involve APIs introduced after the OS was made closed-source would also be inherently more risky than equivalent contributions for other proprietary OSs due to the case of Google LLC v. Oracle America, Inc., wherein Oracle clearly demonstrated its willingness to pursue legal action against entities that merely copy API declarations. Finally, Oracle laid off most of the Solaris team in 2017; the OS has been in maintenance mode since, presumably to be retired completely sometime in the 2030s. For these reasons, this commit removes all Oracle Solaris support. Anyone who still wishes to use Zig on Solaris can try their luck by simply using illumos instead of solaris in target triples - chances are it'll work. But there will be no effort from the Zig team to support this use case; we recommend that people move to illumos instead.
2025-10-23std.Thread: implement freeAndExit() for sh-linuxAlex Rønne Petersen
2025-10-23std.Thread: implement freeAndExit() for microblaze-linuxAlex Rønne Petersen
2025-10-23std.Thread: implement freeAndExit() for hppa-linuxAlex Rønne Petersen
2025-10-23std.Thread: implement freeAndExit() for alpha-linuxAlex Rønne Petersen
2025-10-23std.Thread: implement freeAndExit() for m68k-linuxAlex Rønne Petersen
2025-10-19Merge pull request #25627 from alexrp/qemu-10.1.1-patchedAlex Rønne Petersen
`ci`: switch to patched QEMU 10.1.1.1
2025-10-18std.Thread: implement freeAndExit() for or1kAlex Rønne Petersen
2025-10-18Revert "std.Thread: disable test on armeb in addition to thumbeb"Alex Rønne Petersen
This reverts commit a73f246b2963de0024b9b7070448862e855d5a04.
2025-10-18std.Thread: fix some issues in x86_64/x32 inline asmAlex Rønne Petersen
Wrong syscall on x32; return exit code 0 instead of 1 on both. ref https://github.com/ziglang/zig/issues/22189
2025-10-18std.Thread: fix inline asm for mipsn32Alex Rønne Petersen
This was using the mips64 syscalls. ref https://github.com/ziglang/zig/issues/22189
2025-10-10replaced https://simonsapin.github.io/wtf-8/ with https://wtf-8.codeberg.page/usebeforefree
2025-09-30std: fixesmlugg
2025-09-25std.Thread: disable test on armeb in addition to thumbebAlex Rønne Petersen
Same falky failure on both. See ed7ff0b693037078f451a7c6c1124611060f4892.
2025-09-20allow some test cases to regressAndrew Kelley
tracked by #24061 - these should be re-enabled once that is solved.
2025-09-09Move some Thread tests out of posix/test.zig into Thread.zigPat Tullmann
These tests aren't (directly) using Posix APIs, so they don't need to be in posix/test.zig. Put them over with the code and tests in Thread.zig. Since the spawn/join test in the posix code was redundant, just dropped that one.
2025-08-30Merge pull request #25077 from ziglang/GenericReaderAndrew Kelley
std.Io: delete GenericReader, AnyReader, FixedBufferStream; and related API breakage
2025-08-30rework std.Io.Writer.Allocating to support runtime-known alignmentAndrew Kelley
Also, breaking API changes to: * std.fs.Dir.readFileAlloc * std.fs.Dir.readFileAllocOptions
2025-08-30std.Thread: make unreachable errors in sleep() clearerAlex Rønne Petersen
2025-08-29std.Io: delete GenericReaderAndrew Kelley
and delete deprecated alias std.io
2025-08-28std: delete most remaining uses of GenericWriterAndrew Kelley
2025-08-21drop NameTooLong from sysctlbynameZ error set (#24909)Sardorbek Imomaliev
2025-07-21std.Thread: don't spinAndrew Kelley
2025-07-16zig fmtAndrew Kelley
2025-07-12std.os.uefi.tables: ziggify boot and runtime services (#23441)Carmen
* std.os.uefi.tables: ziggify boot and runtime services * avoid T{} syntax Co-authored-by: linusg <mail@linusgroh.de> * misc fixes * work * self-review quickfixes * dont make MemoryMapSlice generic * more review fixes, work * more work * more work * review fixes * update boot/runtime services references throughout codebase * self-review fixes * couple of fixes i forgot to commit earlier * fixes from integrating in my own project * fixes from refAllDeclsRecursive * Apply suggestions from code review Co-authored-by: truemedian <truemedian@gmail.com> * more fixes from review * fixes from project integration * make natural alignment of Guid align-8 * EventRegistration is a new opaque type * fix getNextHighMonotonicCount * fix locateProtocol * fix exit * partly revert 7372d65 * oops exit data_len is num of bytes * fixes from project integration * MapInfo consistency, MemoryType update per review * turn EventRegistration back into a pointer * forgot to finish updating MemoryType methods * fix IntFittingRange calls * set uefi.Page nat alignment * Back out "set uefi.Page nat alignment" This backs out commit cdd9bd6f7f5fb763f994b8fbe3e1a1c2996a2393. * get rid of some error.NotFound-s * fix .exit call in panic * review comments, add format method * fix resetSystem data alignment * oops, didnt do a final refAllDeclsRecursive i guess * review comments * writergate update MemoryType.format * fix rename --------- Co-authored-by: linusg <mail@linusgroh.de> Co-authored-by: truemedian <truemedian@gmail.com>
2025-07-07std.fmt: breaking API changesAndrew Kelley
added adapter to AnyWriter and GenericWriter to help bridge the gap between old and new API make std.testing.expectFmt work at compile-time std.fmt no longer has a dependency on std.unicode. Formatted printing was never properly unicode-aware. Now it no longer pretends to be. Breakage/deprecations: * std.fs.File.reader -> std.fs.File.deprecatedReader * std.fs.File.writer -> std.fs.File.deprecatedWriter * std.io.GenericReader -> std.io.Reader * std.io.GenericWriter -> std.io.Writer * std.io.AnyReader -> std.io.Reader * std.io.AnyWriter -> std.io.Writer * std.fmt.format -> std.fmt.deprecatedFormat * std.fmt.fmtSliceEscapeLower -> std.ascii.hexEscape * std.fmt.fmtSliceEscapeUpper -> std.ascii.hexEscape * std.fmt.fmtSliceHexLower -> {x} * std.fmt.fmtSliceHexUpper -> {X} * std.fmt.fmtIntSizeDec -> {B} * std.fmt.fmtIntSizeBin -> {Bi} * std.fmt.fmtDuration -> {D} * std.fmt.fmtDurationSigned -> {D} * {} -> {f} when there is a format method * format method signature - anytype -> *std.io.Writer - inferred error set -> error{WriteFailed} - options -> (deleted) * std.fmt.Formatted - now takes context type explicitly - no fmt string
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-03-11std: Add support for SerenityOS in various placesLinus Groh
Not nearly the entire downstream patchset but these are completely uncontroversial and known to work.
2025-02-24stdlib: handle EEXIST in mmap with FIXED_NOREPLACE. Fixes #21475Alec Fessler
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-06adjust runtime page size APIsAndrew Kelley
* fix merge conflicts * rename the declarations * reword documentation * extract FixedBufferAllocator to separate file * take advantage of locals * remove the assertion about max alignment in Allocator API, leaving it Allocator implementation defined * fix non-inline function call in start logic The GeneralPurposeAllocator implementation is totally broken because it uses global state but I didn't address that in this commit.
2025-02-06runtime page size detectionArchbirdplus
heap.zig: define new default page sizes heap.zig: add min/max_page_size and their options lib/std/c: add miscellaneous declarations heap.zig: add pageSize() and its options switch to new page sizes, especially in GPA/stdlib mem.zig: remove page_size
2025-01-19std.Thread: Fix wasi_thread_start() export to use a pointer.Alex Rønne Petersen
Closes #22518.
2025-01-16x86_64: fix crashes compiling the compiler and testsJacob Young
2025-01-15std.Thread: don't export wasi_thread_start in single-threaded modeAndrew Kelley
2024-11-02std.os.windows: Fix some incorrect callconv specifiers.Alex Rønne Petersen
Closes #21869.
2024-10-29remove unnecessary castJonathanHallstrom
2024-10-16std.Thread: Use loongarch freeAndExit() implementation for loongarch32 too.Alex Rønne Petersen
2024-09-26move std.time.sleep to std.Thread.sleepAndrew Kelley
2024-09-07std: Fix assembler comment syntax for sparc.Alex Rønne Petersen