mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-23 05:42:29 +00:00
Clean up some of the threading code
This commit is contained in:
parent
0547eabcd6
commit
9f963dc597
62 changed files with 175 additions and 582 deletions
|
@ -109,7 +109,7 @@ void BenchLockUnlock(pthread_mutex_t *m) {
|
|||
|
||||
BENCH(pthread_mutex_lock, bench_uncontended) {
|
||||
{
|
||||
pthread_spinlock_t s = 0;
|
||||
pthread_spinlock_t s = {0};
|
||||
EZBENCH2("spin 1x", donothing, BenchSpinUnspin(&s));
|
||||
}
|
||||
{
|
||||
|
@ -161,7 +161,7 @@ int MutexContentionWorker(void *arg, int tid) {
|
|||
BENCH(pthread_mutex_lock, bench_contended) {
|
||||
struct spawn t;
|
||||
{
|
||||
pthread_spinlock_t s = 0;
|
||||
pthread_spinlock_t s = {0};
|
||||
struct SpinContentionArgs a = {&s};
|
||||
_spawn(SpinContentionWorker, &a, &t);
|
||||
while (!a.ready) sched_yield();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue