summaryrefslogtreecommitdiff
path: root/src/thread/pthread_spin_lock.c
blob: 0462e0f3a4004ca469cf6f99f7c24566f383a423 (plain) (blame)
1
2
3
4
5
6
7
#include "pthread_impl.h"

int pthread_spin_lock(pthread_spinlock_t *s)
{
	while (*(volatile int *)s || a_cas(s, 0, 1)) a_spin();
	return 0;
}