Parlib
Easing Cross-Platform Development of Next Generation Parallel Systems
Amplab

Table Of Contents

Previous topic

MCS Locks

Next topic

Dynamic Thread Local Storage

This Page

Spinlocks

To access the spinlock API, include the following header file:

#include <parlib/spinlock.h>

Constants

#define SPINLOCK_INITIALIZER

Types

struct spinlock;
typedef struct spinlock spinlock_t;
struct spinlock
spinlock_t

API Calls

void spinlock_init(spinlock_t *lock);
int spinlock_trylock(spinlock_t *lock);
void spinlock_lock(spinlock_t *lock);
void spinlock_unlock(spinlock_t *lock);
void spinlock_init(spinlock_t *lock)
int spinlock_trylock(spinlock_t *lock)
void spinlock_lock(spinlock_t *lock)
void spinlock_unlock(spinlock_t *lock)