Replace log custom spinlocks with SPINLOCK

This commit is contained in:
Johan Wikman
2018-01-03 13:50:00 +02:00
parent df0def9c97
commit 289ae983df
3 changed files with 21 additions and 47 deletions

View File

@ -336,29 +336,6 @@ bool skygw_thread_must_exit(skygw_thread_t* thr)
return thr->sth_must_exit;
}
void acquire_lock(int* l)
{
register int misscount = 0;
struct timespec ts1;
ts1.tv_sec = 0;
while (atomic_add(l, 1) != 0)
{
atomic_add(l, -1);
misscount += 1;
if (misscount > 10)
{
ts1.tv_nsec = misscount * 1000000;
nanosleep(&ts1, NULL);
}
}
}
void release_lock(int* l)
{
atomic_add(l, -1);
}
/**
* @node Create a simple_mutex structure which encapsulates pthread_mutex.
*