diff options
| author | Laytan Laats <laytanlaats@hotmail.com> | 2024-10-30 15:07:56 +0100 |
|---|---|---|
| committer | Laytan Laats <laytanlaats@hotmail.com> | 2024-10-30 15:51:56 +0100 |
| commit | cc3c9bd87116ce8fcb018719a725a71a16eab3b5 (patch) | |
| tree | 1a0eb282a5846ac537852399290ec0af8b76830c /core/fmt | |
| parent | f469bbb0049f618d09dd1dd962389c8306db6bbc (diff) | |
fix thread_unix for Darwin after pthread corrections in posix package
afed3ce removed the sys/unix package and moved over to sys/posix, it has
new bindings for the pthread APIs but should have been equivalent (not).
8fb7182 used `CANCEL_ENABLE :: 0`, `CANCEL_DISABLE :: 1`, `CANCEL_DEFERRED :: 0`, `CANCEL_ASYNCHRONOUS :: 1` for Darwin, while the
correct values are `1`, `0`, `2` and `0` respectively (same mistake was made for
FreeBSD in that commit).
What this meant is that the
`pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS)` was not actually
successful, but because the error wasn't checked it was assumed it was.
It also meant `pthread_setcancelstate(PTHREAD_CANCEL_ENABLE)` would
actually be setting `PTHREAD_CANCEL_DISABLE`.
The code in this PR restores the behaviour by now actually deliberately
setting `PTHREAD_CANCEL_DISABLE` and not setting
`PTHREAD_CANCEL_ASYNCHRONOUS` which was the previous behaviour that does
actually seem to work for some reason.
(I also fixed an issue in fmt where `x` would use uppercase if it was a
pointer.)
Diffstat (limited to 'core/fmt')
| -rw-r--r-- | core/fmt/fmt.odin | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/fmt/fmt.odin b/core/fmt/fmt.odin index 0d11ad8a9..dd5c2c6a2 100644 --- a/core/fmt/fmt.odin +++ b/core/fmt/fmt.odin @@ -1531,7 +1531,7 @@ fmt_pointer :: proc(fi: ^Info, p: rawptr, verb: rune) { case 'o': _fmt_int(fi, u, 8, false, 8*size_of(rawptr), __DIGITS_UPPER) case 'i', 'd': _fmt_int(fi, u, 10, false, 8*size_of(rawptr), __DIGITS_UPPER) case 'z': _fmt_int(fi, u, 12, false, 8*size_of(rawptr), __DIGITS_UPPER) - case 'x': _fmt_int(fi, u, 16, false, 8*size_of(rawptr), __DIGITS_UPPER) + case 'x': _fmt_int(fi, u, 16, false, 8*size_of(rawptr), __DIGITS_LOWER) case 'X': _fmt_int(fi, u, 16, false, 8*size_of(rawptr), __DIGITS_UPPER) case: |