Commit graph

430 commits

Author SHA1 Message Date
Sebastian Ullrich
d58b02a0be fix: translate Windows error codes 2020-12-30 21:07:07 +01:00
Sebastian Ullrich
4a262fbc5b fix: remove auto-cancellation of IO tasks
Chained tasks were never auto-canceled, so let's be explicit everywhere
2020-12-30 17:03:09 +01:00
Sebastian Ullrich
91dac6ccff fix: race condition in Task.bind 2020-12-30 17:01:05 +01:00
Wojciech Nawrocki
3fca58ea8c feat: IO.FS.Handle.size 2020-12-23 20:00:36 +01:00
Leonardo de Moura
c71eebde8c chore: remove util/buffer.h dependency from runtime 2020-12-14 18:07:28 -08:00
Leonardo de Moura
bbafaf8805 fix: Array.mk and Array.data externs 2020-12-13 11:10:01 -08:00
Leonardo de Moura
6a41d04827 fix: missing panics 2020-12-08 10:36:53 -08:00
Leonardo de Moura
b95c4788c1 refactor: OfDecimal ==> OfScientific
`decimalLit` ==> `scientificLit`
2020-12-03 08:08:19 -08:00
Leonardo de Moura
d1f4d4f57e feat: scientific notation 2020-12-03 07:49:20 -08:00
Leonardo de Moura
962cffbaaa feat: add lean_float_of_decimal using GMP 2020-12-03 06:15:18 -08:00
Leonardo de Moura
dfd1f23030 fix: avoid unnecessary page allocation
When import objects deleted by other threads, we may add elements to
`p` free list.
2020-11-29 13:33:59 -08:00
Leonardo de Moura
6dd3616298 fix: import pending objects *before* moving segments
@Kha I stopped getting the assertion violation after this fix.
There is another unrelated issue that I will fix in a separate commit.
2020-11-29 13:26:10 -08:00
Sebastian Ullrich
a22d234e93 fix: Thunk.get: mark result as MT before storing it in the task object 2020-11-29 18:59:39 +01:00
Wojciech Nawrocki
b1e6edefde fix: redirect child I/O to null on Process.Stdio.null
And don't use errno for Win32 API errors.
2020-11-27 13:17:32 -08:00
Sebastian Ullrich
3e09184a39 fix: String.mk, String.toList 2020-10-16 09:42:59 +02:00
Sebastian Ullrich
32b98a1d4a chore: remove obsolete build options & other stuff
TODO: remove JSON with the old frontend
2020-10-14 18:57:11 +02:00
Sebastian Ullrich
8b62665788 chore: print dbg* output to stderr 2020-10-12 10:01:29 +02:00
Sebastian Ullrich
c83529810d fix: avoid deadlock on freeing task-carrying task 2020-10-11 17:43:28 +02:00
Sebastian Ullrich
ab6b6ac3ba feat: add dedicated task priority 2020-09-29 08:01:10 -07:00
Sebastian Ullrich
562c7ed5ce feat: expose task priorities 2020-09-29 08:01:10 -07:00
Sebastian Ullrich
3b8d473188 fix: alloc: do not forget about orphaned pages 2020-09-29 08:01:10 -07:00
Sebastian Ullrich
9dffc61e27 fix: free lthread resources on Windows 2020-09-29 08:01:10 -07:00
Leonardo de Moura
0de92b069f chore: move function 2020-09-21 08:58:41 -07:00
Sebastian Ullrich
fce8ca304b fix: reintroduce code that cancels all remaining tasks on task manager shutdown 2020-09-14 17:57:33 +02:00
Sebastian Ullrich
63d60e6564 fix: more robust m_keep_alive implementation not reliant on RC 2020-09-14 17:57:33 +02:00
Sebastian Ullrich
e8a1f36d0c fix: prevent storing ST closure in MT task 2020-09-14 17:57:33 +02:00
Sebastian Ullrich
b214b27557 fix: prevent storing ST value in MT task object 2020-09-14 17:57:33 +02:00
Sebastian Ullrich
a1c17ade3a fix: use-after-free in keep-alive tasks 2020-09-14 17:57:33 +02:00
Sebastian Ullrich
ac56a9e79f fix: run tasks to completion on task_manager shutdown to prevent leaks 2020-09-14 17:57:33 +02:00
Sebastian Ullrich
fc4428f621 fix: mark Task closures as MT 2020-09-14 17:57:33 +02:00
Sebastian Ullrich
a93a53b4b5 feat: more IO Task functions 2020-09-14 17:57:33 +02:00
Sebastian Ullrich
469a822cc6 chore: checkInterrupted ~> checkCanceled, requestInterrupt ~> cancel 2020-09-14 17:57:33 +02:00
Sebastian Ullrich
77cbaa752c fix: Task: make reference and -j0 semantics eager, simplify 2020-09-14 17:57:33 +02:00
Sebastian Ullrich
5b83ceb1b5 feat: IO.mapTask, IO.bindTask 2020-09-14 17:57:33 +02:00
Sebastian Ullrich
307a833798 feat: implement IO.asTask as primitive using always-run tasks 2020-09-14 17:57:33 +02:00
Sebastian Ullrich
1782352af1 feat: optionally run tasks even when already cancelled 2020-09-14 17:57:33 +02:00
Sebastian Ullrich
4bce9eb9a5 doc: document lean_st_ref_get peculiarity 2020-08-31 15:55:21 +02:00
Sebastian Ullrich
c88784ef9d refactor: consistent io_result_mk* naming
/cc @leodemoura
2020-08-31 11:08:57 +02:00
Sebastian Ullrich
1fb1a6f913 fix: do not expose invalid process handles when not redirected 2020-08-30 14:28:56 -07:00
Sebastian Ullrich
cc909e20e1 fix: handle SIGPIPE 2020-08-30 14:28:56 -07:00
Sebastian Ullrich
9f40e46043 feat: basic process API 2020-08-30 14:28:56 -07:00
Sebastian Ullrich
00f176de8d fix: Windows debug build 2020-08-30 14:28:56 -07:00
Sebastian Ullrich
110ae4b571 feat: replace OS-specific stream redirection with pure-Lean Stream redirection
This avoids the temporary files workaround on macOS and Windows, and makes sure
we can process a `#eval` command and write messages to stdout at the same time.
2020-08-28 10:04:32 -07:00
Sebastian Ullrich
efa119bc94 feat: make std streams Streams 2020-08-28 10:04:32 -07:00
Sebastian Ullrich
56fda835be feat: add ByteArray <-> String conversions 2020-08-28 10:04:32 -07:00
Sebastian Ullrich
dbebff3a2d feat: ByteArray.copySlice 2020-08-28 10:04:32 -07:00
Sebastian Ullrich
1b0ffbb74d feat: make std IO streams settable
Co-authored-by: Simon Hudon <simon.hudon@gmail.com>
2020-08-28 10:04:32 -07:00
Leonardo de Moura
6180ba6d7d chore: rename ST.Ref primitives 2020-08-23 12:28:14 -07:00
Leonardo de Moura
c0dbf60830 feat: remove IO.ref.reset
`reset` was used to implement a "buggy" `IO.ref.modify`.
```lean
@[inline] def Ref.modify {α : Type} (r : Ref α) (f : α → α) : m Unit := do
v ← r.get;
r.reset;
r.set (f v)
```
`IO.Ref.reset` will store a nullptr in `r`.
Now, suppose another thread tries to read this reference,
it will get an `IO.error`.
It is not a crash, but it is really weird behavior.
2020-08-20 10:07:15 -07:00
Leonardo de Moura
e3b1ae514b fix: nontermination
This issue was reported by Simon Winwood at Zulip.
Here is the message

The following code doesn't terminate (in a reasonable amount of time)
```
def large_nat : Nat := (9223372036854775807 : Nat)
```
$ time lean --o=large-nat.olean large-nat.lean
2020-08-18 18:45:28 -07:00