aboutsummaryrefslogtreecommitdiff
path: root/lib/std/Thread.zig
AgeCommit message (Collapse)Author
2021-06-30std.Thread: uh more typo fixeskprotty
2021-06-30std.Thread: more compile error fixeskprotty
2021-06-30std.Thread: fix some typoskprotty
2021-06-30std.Thread: add tests + getCurrentId() returns ints when possiblekprotty
2021-06-30std.Thread: another typo fixkprotty
2021-06-30std.Thread: rewrite + extensionskprotty
2021-06-21std, src, doc, test: remove unused variablesJacob G-W
2021-06-12std.Thread.Futex addition (#9070)protty
* std.Thread.Futex: implementation + tests * std.Thread.Futex: fix darwin compile errors * std.Thread.Futex: fix wait() documentation typo * std.Thread.Futex: fix darwin version check * std.Thread.Futex: remove unnecessary comptime keyword
2021-05-31std.sync.atomic: extended atomic helper functions (#8866)protty
- deprecates `std.Thread.spinLoopHint` and moves it to `std.atomic.spinLoopHint` - added an Atomic(T) generic wrapper type which replaces atomic.Bool and atomic.Int - in Atomic(T), selectively expose member functions depending on T and include bitwise atomic methods when T is an Integer - added fence() and compilerFence() to std.atomic
2021-05-23overhaul elf csu (c-runtime startup) logicMichael Dusan
- more support for linux, android, freebsd, netbsd, openbsd, dragonfly - centralize musl utils; musl logic is no longer intertwined with csu - fix musl compilation to build crti/crtn for full archs list - fix openbsd to support `zig build-lib -dynamic` - initial dragonfly linking success (with a warning) ancillary: - fix emutls (openbsd) tests to use `try`
2021-05-20Run `zig fmt` on src/ and lib/std/Isaac Freund
This replaces callconv(.Inline) with the more idiomatic inline keyword.
2021-05-03std: Add fallback on pre-v6 ARM targetsLemonBoy
Thanks xackus for noticing the missing else branch.
2021-05-03std: Fix missing CPU feature checkLemonBoy
We need both the v6k and the v6m checks.
2021-04-30std: Improve spinloop hintLemonBoy
* Add a yield pattern for PowerPC64 * Fix compile error on pre-v6 ARM targets * Use isb instead of yield on AArch64 to give the CPU a chance to enter low-power states. * Make the hint an inline function, the call overhead can be avoided.
2021-04-26Revert "thread: simplify and remove useless return in spawn (#8621)"Andrew Kelley
This reverts commit 77cb45f59f7b37c316af1762298d6032e2b130b5. Zig's error return traces will point to the return token if they happen to occur, so having multiple return statements makes those stack traces really helpful. This destroys debuggability.
2021-04-26thread: simplify and remove useless return in spawn (#8621)Vincent Rischmann
2021-04-25std: Fix thread creation with field-less context typeLemonBoy
Closes #8524
2021-03-12make std.c.getErrno() return same type as _errno() aka c_intSébastien Marie
adjust std.os.unexpectedErrno() to be correct for all std.os.system.errno (c_int, u12, usize, ...)
2021-02-28std: Swap arguments in Thread.spawnLemonBoy
Beside the new order being consistent with the ThreadPool API and making more sense, this shuffling allows to write the context argument type in terms of the startFn arguments, reducing the use of anytype (eg. less explicit casts when using comptime_int parameters, yay). Sorry for the breakage. Closes #8082
2021-02-25haiku: minor fixupsAndrew Kelley
* no isHaiku() function since there is not more than one os tag that this applies to. * clean up some control flow into a switch * add some TODO comments to investigate panics that suspiciously look like they should be compile errors (see #363)
2021-02-25initial support for haiku sync updateAl Hoang
* add cpu count * use haiku find_directory * add definitions and exports for building in haiku
2021-02-24zig fmt the std libAndrew Kelley
2021-01-22std: Update `test ""` to `test` where it makes senseLemonBoy
2021-01-14std.Thread: avoid compile errors for single-threaded OS'sAndrew Kelley
2021-01-14organize std lib concurrency primitives and add RwLockAndrew Kelley
* move concurrency primitives that always operate on kernel threads to the std.Thread namespace * remove std.SpinLock. Nobody should use this in a non-freestanding environment; the other primitives are always preferable. In freestanding, it will be necessary to put custom spin logic in there, so there are no use cases for a std lib version. * move some std lib files to the top level fields convention * add std.Thread.spinLoopHint * add std.Thread.Condition * add std.Thread.Semaphore * new implementation of std.Thread.Mutex for Windows and non-pthreads Linux * add std.Thread.RwLock Implementations provided by @kprotty