summaryrefslogtreecommitdiffstats
path: root/labb8/lib/StanfordCPPLib/private/tplatform.h
blob: 6cf4bae7c3a7456982008c9064719909029b736d (plain) (blame)
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
/*
 * File: tplatform.h
 * -----------------
 * This interface defines the platform-specific methods on threads
 * and locks.
 */

/* Methods for threads */

int forkForPlatform(void (*fn)(void *), void *arg);
void incThreadRefCountForPlatform(int id);
void decThreadRefCountForPlatform(int id);
void joinForPlatform(int id);
int getCurrentThreadForPlatform();
void yieldForPlatform();

/* Methods for locks */

int initLockForPlatform();
void incLockRefCountForPlatform(int id);
void decLockRefCountForPlatform(int id);
void lockForPlatform(int id);
void unlockForPlatform(int id);
void waitForPlatform(int id);
void signalForPlatform(int id);