summaryrefslogtreecommitdiffstats
path: root/labb5/lib/StanfordCPPLib/private/tplatform.h
diff options
context:
space:
mode:
authorGustav Sörnäs <gustav@sornas.net>2020-11-17 15:42:27 +0100
committerGustav Sörnäs <gustav@sornas.net>2020-11-17 15:42:27 +0100
commitfb80ac50825c7ca1fa063d3493175b7b27adbdb1 (patch)
tree4d84895d45ca2c177ddefe11164575bf6762b3ca /labb5/lib/StanfordCPPLib/private/tplatform.h
parent4065799f7080260f507a5e3ea8c2d8375e735166 (diff)
downloadtddd86-fb80ac50825c7ca1fa063d3493175b7b27adbdb1.tar.gz
add given code
Diffstat (limited to 'labb5/lib/StanfordCPPLib/private/tplatform.h')
-rwxr-xr-xlabb5/lib/StanfordCPPLib/private/tplatform.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/labb5/lib/StanfordCPPLib/private/tplatform.h b/labb5/lib/StanfordCPPLib/private/tplatform.h
new file mode 100755
index 0000000..6cf4bae
--- /dev/null
+++ b/labb5/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);