aboutsummaryrefslogtreecommitdiff
path: root/lib/std/event
AgeCommit message (Collapse)Author
2022-08-22stage2+stage1: remove type parameter from bit builtinsVeikka Tuominen
Closes #12529 Closes #12511 Closes #6835
2022-07-01std.event: use .{} to initiate Lock to unlocked stateMikko Kaihlavirta
Co-authored-by: Mikko Kaihlavirta <kaihlavirta@gmail.com>
2022-06-03std: disable tests that crash stage2Veikka Tuominen
2022-04-27std: replace usage of std.meta.bitCount() with @bitSizeOf()Isaac Freund
2022-04-26std.Thread: ResetEvent improvements (#11523)protty
* std: start removing redundant ResetEvents * src: fix other uses of std.Thread.ResetEvent * src: add builtin.sanitize_thread for tsan detection * atomic: add Atomic.fence for proper fencing with tsan * Thread: remove the other ResetEvent's and rewrite the current one * Thread: ResetEvent docs * zig fmt + WaitGroup.reset() fix * src: fix build issues for ResetEvent + tsan * Thread: ResetEvent tests * Thread: ResetEvent module doc * Atomic: replace llvm *p memory constraint with *m * panicking: handle spurious wakeups in futex.wait() when waiting for abort() * zig fmt
2022-04-11std.event.WaitGroup: fix compilation (acquire->lock, release->unlock)Stephen Gutekanst
In 008b0ec5e58fc7e31f3b989868a7d1ea4df3f41d the `std.Thread.Mutex` API was changed from `acquire` and `release` to `lock` and `unlock`. `std.event.Lock` still uses `acquire` and `release`. `std.event.WaitGroup` is using `std.Thread.Mutex` and was not updated to use `lock` and `unlock`, and so compilation failed prior to this commit. Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-03-29std: avoid referencing event loop when io_mode is blockingAndrew Kelley
This prevents unwanted symbols from ending up in the output binary.
2021-11-30allocgate: renamed getAllocator function to allocatorLee Cannon
2021-11-30allocgate: stage 1 and 2 buildingLee Cannon
2021-11-30allocgate: std Allocator interface refactorLee Cannon
2021-11-09std.Thread.Mutex: change API to lock() and unlock()Andrew Kelley
This is a breaking change. Before, usage looked like this: ```zig const held = mutex.acquire(); defer held.release(); ``` Now it looks like this: ```zig mutex.lock(); defer mutex.unlock(); ``` The `Held` type was an idea to make mutexes slightly safer by making it more difficult to forget to release an aquired lock. However, this ultimately caused more problems than it solved, when any data structures needed to store a held mutex. Simplify everything by reducing the API down to the primitives: lock() and unlock(). Closes #8051 Closes #8246 Closes #10105
2021-10-04migrate from `std.Target.current` to `@import("builtin").target`Andrew Kelley
closes #9388 closes #9321
2021-09-08openbsd: readapt event loop after usingnamespace changesSébastien Marie
2021-09-07openbsd: event loop: use EVFILT_TIMER instead of EVFILT_USERSébastien Marie
OpenBSD doesn't implement EVFILT_USER filter for kqueue(2), so we couldn't use that for event loop. instead, use a EVFILT_TIMER filter with EV_ONESHOT (trigger only once) and delay 0sec (which trigger immediatly). it fits the usage of EVFILT_USER which is only used to "wakeup" the kevent(2) call from userland.
2021-09-06std: update event loop for recent usingnamespace changesJacob G-W
2021-09-01std: fix regressions from this branchAndrew Kelley
Also move some usingnamespace test cases from compare_output to behavior.
2021-09-01std: reorganization that allows new usingnamespace semanticsAndrew Kelley
The proposal #9629 is now accepted, usingnamespace stays but no longer puts identifiers in scope.
2021-09-01std.os: more reorganization effortsAndrew Kelley
* std lib tests are passing on x86_64-linux with and without -lc * stage2 is building from source on x86_64-linux * down to 38 remaining uses of `usingnamespace`
2021-08-24remove redundant license headers from zig standard libraryAndrew Kelley
We already have a LICENSE file that covers the Zig Standard Library. We no longer need to remind everyone that the license is MIT in every single file. Previously this was introduced to clarify the situation for a fork of Zig that made Zig's LICENSE file harder to find, and replaced it with their own license that required annual payments to their company. However that fork now appears to be dead. So there is no need to reinforce the copyright notice in every single file.
2021-06-30std.Thread: even more typo fixeskprotty
2021-06-30std.Thread.getCpuCount(): fix usageskprotty
2021-06-30changes to accomodate std.Thread updatekprotty
2021-06-23nice error for unsupported async sockets on WindowsJonathan Marler
2021-06-21fix code broken from previous commitJacob G-W
2021-06-21std, src, doc, test: remove unused variablesJacob G-W
2021-06-13std.windows: fix `OVERLAPPED`, add `OVERLAPPED_ENTRY`viri
2021-05-08Merge remote-tracking branch 'origin/master' into stage2-whole-file-astgenAndrew Kelley
Conflicts: * doc/langref.html.in * lib/std/enums.zig * lib/std/fmt.zig * lib/std/hash/auto_hash.zig * lib/std/math.zig * lib/std/mem.zig * lib/std/meta.zig * test/behavior/alignof.zig * test/behavior/bitcast.zig * test/behavior/bugs/1421.zig * test/behavior/cast.zig * test/behavior/ptrcast.zig * test/behavior/type_info.zig * test/behavior/vector.zig Master branch added `try` to a bunch of testing function calls, and some lines also had changed how to refer to the native architecture and other `@import("builtin")` stuff.
2021-05-08std: update usage of std.testingVeikka Tuominen
2021-04-24Merge remote-tracking branch 'origin/master' into stage2-whole-file-astgenAndrew Kelley
In particular I wanted the change that makes `suspend;` illegal in the parser.
2021-04-24stage1: Require a block after suspendLemonBoy
Closes #8603
2021-04-15std: change `@import("builtin")` to `std.builtin`Andrew Kelley
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-24zig fmt the std libAndrew Kelley
2021-02-21fix race condition in linuxWaitFdBill Nagel
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
2021-01-11std.event.Loop: fix race condition when starting the time wheelAndrew Kelley
closes #7572
2020-12-31Year++Frank Denis
2020-12-28Update event loop sendto error to SendToErrorfrmdstryr
2020-12-26std.event.Loop: fix regression with ResetEventAndrew Kelley
2020-11-16linuxWaitFd: make NetworkSubsystemFailed error unreachableheidezomp
This error from os.poll is Windows-specific, so unreachable on Linux.
2020-11-01Add missing argfrmdstryr
2020-10-27std/event: fix zig fmt regressionIsaac Freund
2020-10-27std/event: fix poll error set handlingIsaac Freund
This has been broken since 127fa80
2020-10-17Merge branch 'openbsd-minimal' of https://github.com/semarie/zig into ↵Andrew Kelley
semarie-openbsd-minimal
2020-10-17Merge branch 'master' into openbsd-minimalSebastien Marie
2020-10-17Make std.meta.Int accept a signedness parameterJan Prudil
2020-10-14Merge pull request #6655 from kprotty/timersAndrew Kelley
Integrate std.time.sleep with the event loop
2020-10-14Event Channel: updated linked list node initialization (#6652)Matthew Knight
fixed node init method
2020-10-12Rename .macosx to .macosVignesh Rajagopalan
2020-10-11Add more comments & cleanup AutoResetEventkprotty