summaryrefslogtreecommitdiff
path: root/gthread.h
diff options
context:
space:
mode:
Diffstat (limited to 'gthread.h')
-rw-r--r--gthread.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/gthread.h b/gthread.h
new file mode 100644
index 0000000..3cacd0b
--- /dev/null
+++ b/gthread.h
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2023 Mikhail Burakov. This file is part of toolbox.
+ *
+ * toolbox is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * toolbox is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with toolbox. If not, see <https://www.gnu.org/licenses/>.
+ */
+
+#ifndef TOOLBOX_GTHREAD_H_
+#define TOOLBOX_GTHREAD_H_
+
+#include <stdbool.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif // __cplusplus
+
+struct GThread;
+
+struct GThread* GThreadCreate(void (*proc)(void*), void* user);
+bool GThreadWake(struct GThread* thread);
+bool GThreadYield(void);
+void GThreadDestroy(struct GThread* thread);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif // __cplusplus
+
+#endif // TOOLBOX_GTHREAD_H_