summaryrefslogtreecommitdiff
path: root/sys/include/spinlock.h
blob: 82c15854ffc7bf81efbfe36740ccdbab03123d3c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#ifndef _SPINLOCK_H
#define _SPINLOCK_H

/* fifo ticket lock implementation */ 

typedef struct _spinlock {
	int ticket;
	int turn;
} spinlock_t;

void initlock(spinlock_t *);

void acquire(spinlock_t *);

void release(spinlock_t *);

#endif /* _SPINLOCK_H */