* 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
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.
A simple empty main with evented-io would not quit, because some
threads were still waiting to be resumed (by the os). The os.write to
the eventfd only wakes up one thread and thus there are multiple writes
needed to wake up all the other threads.
std.event.Loop does not yet work in single threaded builds. However,
using evented io on a single thread can be very convenient. This commit
allows settind @import("root").event_loop_mode to .single_threaded
in order to allow this without reimplementing the startup code in
start.zig
Remove the constants that assume a base unit in favor of explicit
x_per_y constants.
nanosecond calendar timestamps now use i128 for the type. This affects
fs.File.Stat, std.time.nanoTimestamp, and fs.File.updateTimes.
calendar timestamps are now signed, because the value can be less than
the epoch (the user can set their computer time to whatever they wish).
implement std.os.clock_gettime for Windows when clock id is
CLOCK_CALENDAR.