aboutsummaryrefslogtreecommitdiff
path: root/lib/std/thread.zig
AgeCommit message (Collapse)Author
2020-05-05Update ErrorUnion thread spawn result to return null instead of 0Haze Booth
2020-04-25std: fix posix Thread.spawn to accept all startFn typesAndrius Mitkus
2020-03-30std lib API deprecations for the upcoming 0.6.0 releaseAndrew Kelley
See #3811
2020-03-28std: Minor changes to TLS handlingLemonBoy
* Always allocate an info block per-thread so that libc can store important stuff there. * Respect ABI-mandated alignment in more places. * Nicer code, use slices/pointers instead of raw addresses whenever possible.
2020-03-25Revert "Merge pull request #4807 from LemonBoy/tls-touchups"Andrew Kelley
This reverts commit ee6fda2297bf75432b8d7115ec4c60c213535bbe, reversing changes made to f313ab18aecea1ade0b6a90d671352a641ad351a. This caused a test failure: ``` behavior.misc.test "behavior-arm-linux-none-Debug-bare-multi thread local variable"...test failure /home/vsts/work/1/s/lib/std/testing.zig:191:14: 0x4608f in std.testing.expect (test) if (!ok) @panic("test failure"); ^ /home/vsts/work/1/s/test/stage1/behavior/misc.zig:616:11: 0x53e93 in behavior.misc.test "behavior-arm-linux-none-Debug-bare-multi thread local variable" (test) expect(S.t == 1235); ^ ```
2020-03-25Merge pull request #4807 from LemonBoy/tls-touchupsAndrew Kelley
std: Minor changes to TLS handling
2020-03-25Use const instead of varLemonBoy
2020-03-25std: Minor changes to TLS handlingLemonBoy
* Always allocate an info block per-thread so that libc can store important stuff there. * Respect ABI-mandated alignment in more places. * Nicer code, use slices/pointers instead of raw addresses whenever possible.
2020-03-23std: Tell pthread the guard page size is zeroLemonBoy
On NetBSD this is needed to avoid crashes in pthread_join as the default value for the guard page size is not ignored even though a custom stack address is specified.
2020-03-23std: Fix parameters for pthread_attr_setstackLemonBoy
The guard page size shouldn't be taken into account, pthread is only interested in the usable area.
2020-03-23std: Different thread stack allocation for NetBSDLemonBoy
* NetBSD is stricter than other OSs and doesn't allow mprotect to mark a non-accessible region as RW * Fix mprotect call over the whole stack, oops
2020-03-18std: More type checks for Thread startFn return typeLemonBoy
Closes #4756
2020-02-29std.Thread.cpuCount on Windows uses the PEBAndrew Kelley
rather than calling GetSystemInfo from kernel32.dll. Also remove OutOfMemory from the error set.
2020-02-29Handle one more errorLemonBoy
2020-02-28introduce operating system version ranges as part of the targetAndrew Kelley
* re-introduce `std.build.Target` which is distinct from `std.Target`. `std.build.Target` wraps `std.Target` so that it can be annotated as "the native target" or an explicitly specified target. * `std.Target.Os` is moved to `std.Target.Os.Tag`. The former is now a struct which has the tag as well as version range information. * `std.elf` gains some more ELF header constants. * `std.Target.parse` gains the ability to parse operating system version ranges as well as glibc version. * Added `std.Target.isGnuLibC()`. * self-hosted dynamic linker detection and glibc version detection. This also adds the improved logic using `/usr/bin/env` rather than invoking the system C compiler to find the dynamic linker when zig is statically linked. Related: #2084 Note: this `/usr/bin/env` code is work-in-progress. * `-target-glibc` CLI option is removed in favor of the new `-target` syntax. Example: `-target x86_64-linux-gnu.2.27` closes #1907
2020-02-24remove uses of `@ArgType` and `@IntType`Vexu
2020-02-24remove usages of `@typeId`, `@memberCount`, `@memberName` and `@memberType`Vexu
2020-01-06zig fmt and update `extern fn` to `callconv(.C)`Andrew Kelley
2019-12-10Additional replacements of @typeOf with @TypeOfRobin Voetter
2019-12-10Replace @typeOf with @TypeOf in all zig sourceRobin Voetter
This change was mostly made with `zig fmt` and this also modified some whitespace. Note that in some files, `zig fmt` produced incorrect code, so the change was made manually.
2019-12-02Merge pull request #3715 from daurnimator/towards-afdAndrew Kelley
Misc windows additions+fixes
2019-12-02bring your own OS layer in the std libAndrew Kelley
closes #3784
2019-11-30linux-i386 supportLemonBoy
2019-11-27std: add alertable argument for windows.WaitForSingleObjectdaurnimator
2019-11-21string literals are now null terminatedAndrew Kelley
this also deletes C string literals from the language, and then makes the std lib changes and compiler changes necessary to get the behavior tests and std lib tests passing again.
2019-11-08update the codebase to use `@as`Andrew Kelley
2019-10-24get rid of std.os.foo.is_the_targetAndrew Kelley
It had the downside of running all the comptime blocks and resolving all the usingnamespaces of each system, when just trying to discover if the current system is a particular one. For Darwin, where it's nice to use `std.Target.current.isDarwin()`, this demonstrates the utility that #425 would provide.
2019-09-25mv std/ lib/Andrew Kelley
that's all this commit does. further commits will fix cli flags and such. see #2221