From 0c39051ba80f04b1177833a006f2d442a7170b56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustav=20S=C3=B6rn=C3=A4s?= Date: Thu, 3 Dec 2020 17:11:43 +0100 Subject: add initial files l8 --- labb8/lib/StanfordCPPLib/private/tplatform.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 labb8/lib/StanfordCPPLib/private/tplatform.h (limited to 'labb8/lib/StanfordCPPLib/private/tplatform.h') diff --git a/labb8/lib/StanfordCPPLib/private/tplatform.h b/labb8/lib/StanfordCPPLib/private/tplatform.h new file mode 100755 index 0000000..6cf4bae --- /dev/null +++ b/labb8/lib/StanfordCPPLib/private/tplatform.h @@ -0,0 +1,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); -- cgit v1.2.1