lean4-htt/src/runtime
Henrik Böving 6d5ce9b87f
refactor: implement IO.waitAny using Lean (#9732)
This PR re-implements `IO.waitAny` using Lean instead of C++. This is to
reduce the size and
complexity of `task_manager` in order to ease future refactorings.

There is an import behavioral change of `IO.waitAny` in this PR.
Consider a situation where we have
two promises `p1`, `p2` and call `IO.waitAny [p1.result!, p2.result!]`
and `p1` resolves instantly.
Previously this would just return the result of `p1` and require nothing
else. With the new
implementation if `p2` is released before being resolved this can cause
a panic, even if
`IO.waitAny` has already finished. I argue that this is reasonable
behavior, given that an
invocation of `result!` promises that the promise will eventually be
resolved.
2025-08-06 13:09:15 +00:00
..
uv fix: handle NUL bytes in IO functions (#9616) 2025-08-01 06:12:53 +00:00
alloc.cpp fix: heartbeats from realizeConst should be ignored (#7473) 2025-03-13 15:10:29 +00:00
alloc.h fix: heartbeats from realizeConst should be ignored (#7473) 2025-03-13 15:10:29 +00:00
allocprof.cpp
allocprof.h
apply.cpp
apply.h
array_ref.h
buffer.h
CMakeLists.txt feat: add system information functions to the standard library (#8109) 2025-06-27 16:31:34 +00:00
compact.cpp chore: lean --stats gives number of imported bytes (#8725) 2025-06-12 08:29:42 +00:00
compact.h chore: lean --stats gives number of imported bytes (#8725) 2025-06-12 08:29:42 +00:00
debug.cpp
debug.h
exception.cpp
exception.h
flet.h
hash.cpp
hash.h
init_module.cpp
init_module.h
int.h
interrupt.cpp
interrupt.h
io.cpp refactor: implement IO.waitAny using Lean (#9732) 2025-08-06 13:09:15 +00:00
io.h fix: handle NUL bytes in IO functions (#9616) 2025-08-01 06:12:53 +00:00
libuv.cpp feat: add lean_setup_libuv for initializing required LIBUV components (#8636) 2025-06-27 11:11:17 +00:00
libuv.h feat: add DNS resolution functions to the standard library (#8072) 2025-06-27 11:11:47 +00:00
list_ref.h
memory.cpp
memory.h
mpn.cpp
mpn.h
mpz.cpp fix: undefined symbol without LEAN_USE_GMP (#9106) 2025-07-03 16:50:21 +00:00
mpz.h feat: optimized division without remainder for Int and Nat (#8089) 2025-04-29 07:23:35 +00:00
mutex.cpp feat: add Std.SharedMutex (#7770) 2025-04-03 08:30:54 +00:00
mutex.h
object.cpp refactor: implement IO.waitAny using Lean (#9732) 2025-08-06 13:09:15 +00:00
object.h refactor: implement IO.waitAny using Lean (#9732) 2025-08-06 13:09:15 +00:00
object_ref.cpp
object_ref.h
option_ref.h
optional.h
pair_ref.h perf: add missing std::moves (#9107) 2025-07-01 12:39:12 +00:00
platform.cpp feat: ignore lean -R if module name is in setup (#8874) 2025-06-23 17:55:52 +00:00
platform.h
process.cpp feat: IO.Process.SpawnArgs.inheritEnv (#6081) 2025-04-16 00:25:32 +00:00
process.h
sharecommon.cpp feat: support mpz in the shareCommon APIs (#7838) 2025-04-06 19:52:50 +00:00
sharecommon.h perf: use mimalloc with important C++ hash maps (#7868) 2025-04-11 16:23:33 +00:00
sstream.h
stack_overflow.cpp
stack_overflow.h
stackinfo.cpp
stackinfo.h
string_ref.h
thread.cpp chore: remove old LEAN_AUTO_THREAD_FINALIZATION workaround (#8885) 2025-06-20 08:52:17 +00:00
thread.h feat: add Std.SharedMutex (#7770) 2025-04-03 08:30:54 +00:00
utf8.cpp
utf8.h