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/smisc.c
vendored
8
third_party/gdtoa/smisc.c
vendored
|
@ -33,27 +33,27 @@
|
|||
/* clang-format off */
|
||||
|
||||
Bigint *
|
||||
__gdtoa_s2b(const char *s, int nd0, int nd, ULong y9, int dplen)
|
||||
__gdtoa_s2b(const char *s, int nd0, int nd, ULong y9, int dplen, ThInfo **PTI)
|
||||
{
|
||||
Bigint *b;
|
||||
int i, k;
|
||||
Long x, y;
|
||||
x = (nd + 8) / 9;
|
||||
for(k = 0, y = 1; x > y; y <<= 1, k++) ;
|
||||
b = __gdtoa_Balloc(k);
|
||||
b = __gdtoa_Balloc(k, PTI);
|
||||
b->x[0] = y9;
|
||||
b->wds = 1;
|
||||
i = 9;
|
||||
if (9 < nd0) {
|
||||
s += 9;
|
||||
do b = __gdtoa_multadd(b, 10, *s++ - '0');
|
||||
do b = __gdtoa_multadd(b, 10, *s++ - '0', PTI);
|
||||
while(++i < nd0);
|
||||
s += dplen;
|
||||
}
|
||||
else
|
||||
s += dplen + 9;
|
||||
for(; i < nd; i++)
|
||||
b = __gdtoa_multadd(b, 10, *s++ - '0');
|
||||
b = __gdtoa_multadd(b, 10, *s++ - '0', PTI);
|
||||
return b;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue