Commit Graph

123 Commits

Author SHA1 Message Date
Andrew Kelley 5619ce2406 Merge remote-tracking branch 'origin/master' into stage2-whole-file-astgen
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-08 14:45:21 -07:00
Veikka Tuominen fd77f2cfed std: update usage of std.testing 2021-05-08 15:15:30 +03:00
Andrew Kelley e86cee258c Merge remote-tracking branch 'origin/master' into stage2-whole-file-astgen
In particular I wanted the change that makes `suspend;` illegal in the
parser.
2021-04-24 10:44:41 -07:00
LemonBoy 0aede1a8fc stage1: Require a block after suspend
Closes #8603
2021-04-24 10:25:43 +02:00
Andrew Kelley 429cd2b5dd std: change @import("builtin") to std.builtin 2021-04-15 19:06:39 -07:00
LemonBoy 566adc2510 std: Swap arguments in Thread.spawn
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-28 14:03:19 +01:00
Andrew Kelley 5f35dc0c0d zig fmt the std lib 2021-02-24 21:29:23 -07:00
Bill Nagel cc5e5cca83 fix race condition in linuxWaitFd 2021-02-21 12:16:48 +02:00
Andrew Kelley a9667b5a85 organize std lib concurrency primitives and add RwLock
* 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-14 20:41:37 -07:00
Andrew Kelley 8ea2b40e5f std.event.Loop: fix race condition when starting the time wheel
closes #7572
2021-01-11 22:23:03 -07:00
Frank Denis 6c2e0c2046 Year++ 2020-12-31 15:45:24 -08:00
frmdstryr dd86e9d78c Update event loop sendto error to SendToError 2020-12-28 01:00:23 +02:00
Andrew Kelley 4cc4b54d25 std.event.Loop: fix regression with ResetEvent 2020-12-26 19:40:10 -07:00
heidezomp 9ea4ddae97 linuxWaitFd: make NetworkSubsystemFailed error unreachable
This error from os.poll is Windows-specific, so unreachable on Linux.
2020-11-16 14:03:19 -08:00
frmdstryr 36f1788762 Add missing arg 2020-11-01 15:40:42 -05:00
Isaac Freund 504f259c24 std/event: fix zig fmt regression 2020-10-27 21:40:22 +01:00
Isaac Freund 1b34365ca1 std/event: fix poll error set handling
This has been broken since 127fa80
2020-10-27 21:28:31 +01:00
Andrew Kelley 03f7cffce9 Merge branch 'openbsd-minimal' of https://github.com/semarie/zig into semarie-openbsd-minimal 2020-10-17 17:34:43 -07:00
Sebastien Marie 35a7247a2c Merge branch 'master' into openbsd-minimal 2020-10-17 17:38:23 +02:00
Jan Prudil aadccc4206 Make std.meta.Int accept a signedness parameter 2020-10-17 14:09:59 +02:00
Andrew Kelley 3b4432d9a6 Merge pull request #6655 from kprotty/timers
Integrate std.time.sleep with the event loop
2020-10-14 21:49:45 -04:00
Matthew Knight 352976ed23 Event Channel: updated linked list node initialization (#6652)
fixed node init method
2020-10-14 21:33:53 -04:00
Vignesh Rajagopalan 2ab0c7391a Rename .macosx to .macos 2020-10-12 18:56:25 -04:00
kprotty 12508025a4 Add more comments & cleanup AutoResetEvent 2020-10-11 19:16:07 -05:00
kprotty e9a4c3dd82 fix DelayQueue typos 2020-10-11 14:21:36 -05:00
kprotty aa53f6d0b5 integrate std.time.sleep with the event loop 2020-10-11 14:18:19 -05:00
Sébastien Marie f33a610c84 add minimal openbsd support 2020-10-11 08:23:36 +00:00
Loris Cro 53dee08af9 add WaitGroup to std.event
Signed-off-by: Loris Cro <kappaloris@gmail.com>
2020-10-07 04:34:09 -04:00
Andrew Kelley 7f7e2d608a Revert "revert adding std.event.Loop.runDetached"
This reverts commit 70f3767903.

After discussion, I can see the value provided here, specifically with
avoiding the footgun of defer { suspend { free(@frame()); } }.

However the doc comments are updated to explain the semantics directly,
rather than basing them on the behavior of another programming language.
2020-10-05 14:41:51 -07:00
Andrew Kelley 70f3767903 revert adding std.event.Loop.runDetached
I'd like to discuss this before adding it. I think this is the wrong
direction to go with this API.
2020-10-03 17:13:22 -07:00
Alexandros Naskos bf0afaa876 std.event.Loop.runDetached should be pub 2020-10-01 16:50:05 +03:00
Alexandros Naskos beda6f2299 Merge pull request #6455 from kristoff-it/event-loop-go
add runDetached to event loop
2020-10-01 15:57:02 +03:00
Loris Cro 16f0419700 add runDetached to event loop
Signed-off-by: Loris Cro <kappaloris@gmail.com>
2020-09-29 14:53:36 +02:00
Loris Cro a45a4230bc Fix std.event.Future
Signed-off-by: Loris Cro <kappaloris@gmail.com>
2020-09-29 11:18:35 +02:00
kprotty 468a4bf0b4 address some review changes 2020-09-28 07:25:51 -05:00
kprotty a31d9f92f2 new std.event.Lock implementation 2020-09-27 14:05:38 -05:00
Andrew Kelley a502604702 Merge pull request #6412 from kristoff-it/generalize-event-loop
Make os.zig not depend on the event loop
2020-09-25 17:26:44 -04:00
Andrew Kelley f8b3543cab I think this test is still flakey
re-opens #4922
2020-09-24 22:57:03 -07:00
Loris Cro c196c27af8 recvfrom
Signed-off-by: Loris Cro <kappaloris@gmail.com>
2020-09-24 22:06:41 +02:00
Loris Cro 419aea54cb sendto
Signed-off-by: Loris Cro <kappaloris@gmail.com>
2020-09-24 22:06:41 +02:00
Loris Cro 7fec5b3def pwritev
Signed-off-by: Loris Cro <kappaloris@gmail.com>
2020-09-24 22:06:41 +02:00
Loris Cro 7a07c62a07 pwrite
Signed-off-by: Loris Cro <kappaloris@gmail.com>
2020-09-24 22:06:21 +02:00
Loris Cro 18f6629bd8 writev
Signed-off-by: Loris Cro <kappaloris@gmail.com>
2020-09-24 22:06:03 +02:00
Loris Cro 9075f8e5a1 write
Signed-off-by: Loris Cro <kappaloris@gmail.com>
2020-09-24 22:05:41 +02:00
Loris Cro 59ecdaea12 preadv
Signed-off-by: Loris Cro <kappaloris@gmail.com>
2020-09-24 22:04:43 +02:00
Loris Cro bd9f2369d5 pread
Signed-off-by: Loris Cro <kappaloris@gmail.com>
2020-09-24 22:04:05 +02:00
Loris Cro bc35435ca6 readv
Signed-off-by: Loris Cro <kappaloris@gmail.com>
2020-09-24 22:03:12 +02:00
Loris Cro 08364ac773 read
Signed-off-by: Loris Cro <kappaloris@gmail.com>
2020-09-24 22:00:55 +02:00
Loris Cro 730428bfd6 connect
Signed-off-by: Loris Cro <kappaloris@gmail.com>
2020-09-24 21:56:27 +02:00
Loris Cro e85c89630e accept
Signed-off-by: Loris Cro <kappaloris@gmail.com>
2020-09-24 21:56:27 +02:00