-
Notifications
You must be signed in to change notification settings - Fork 0
/
lock.h
27 lines (21 loc) · 1.05 KB
/
lock.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/*****************************************************************************/
/* File: lock.h */
/* */
/* Description: Header file for synchonization primitives. */
/* */
/* Author: Shoily O Rahman <shoily@gmail.com> */
/* */
/* Date: Oct 16, 2020 */
/* */
/*****************************************************************************/
#ifndef _LOCK_H
#define _LOCK_H
#include "util.h"
#include "page32.h"
typedef struct _spinlock {
int val;
} spinlock;
#define INIT_SPIN_LOCK(lock) memset((lock), 0, sizeof(spinlock))
void spinlock_lock(spinlock *lock);
void spinlock_unlock(spinlock *lock);
#endif