mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-07 11:48:30 +00:00
Make improvements to locking
This change makes pthread_mutex_lock() as fast as _spinlock() by default. Thread instability issues on NetBSD have been resolved. Improvements made to gdtoa thread code. Crash reporting will now synchronize between threads in a slightly better way.
This commit is contained in:
parent
25041b8026
commit
d5312b60f7
60 changed files with 890 additions and 629 deletions
8
third_party/gdtoa/sum.c
vendored
8
third_party/gdtoa/sum.c
vendored
|
@ -33,7 +33,7 @@
|
|||
/* clang-format off */
|
||||
|
||||
Bigint *
|
||||
__gdtoa_sum(Bigint *a, Bigint *b)
|
||||
__gdtoa_sum(Bigint *a, Bigint *b, ThInfo **PTI)
|
||||
{
|
||||
Bigint *c;
|
||||
ULong carry, *xc, *xa, *xb, *xe, y;
|
||||
|
@ -41,7 +41,7 @@ __gdtoa_sum(Bigint *a, Bigint *b)
|
|||
if (a->wds < b->wds) {
|
||||
c = b; b = a; a = c;
|
||||
}
|
||||
c = __gdtoa_Balloc(a->k);
|
||||
c = __gdtoa_Balloc(a->k, PTI);
|
||||
c->wds = a->wds;
|
||||
carry = 0;
|
||||
xa = a->x;
|
||||
|
@ -66,9 +66,9 @@ __gdtoa_sum(Bigint *a, Bigint *b)
|
|||
}
|
||||
if (carry) {
|
||||
if (c->wds == c->maxwds) {
|
||||
b = __gdtoa_Balloc(c->k + 1);
|
||||
b = __gdtoa_Balloc(c->k + 1, PTI);
|
||||
Bcopy(b, c);
|
||||
__gdtoa_Bfree(c);
|
||||
__gdtoa_Bfree(c, PTI);
|
||||
c = b;
|
||||
}
|
||||
c->x[c->wds++] = 1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue