aboutsummaryrefslogtreecommitdiff
path: root/core/thread
diff options
context:
space:
mode:
authorDragos Popescu <dragos.andreip@yahoo.com>2023-03-20 04:08:48 +0100
committerDragos Popescu <dragos.andreip@yahoo.com>2023-03-20 04:08:48 +0100
commitadac039a2b612a811d02a47480becc23d02599e1 (patch)
tree8cfb0795a3895f6c38996c21ff620e03b8be9a82 /core/thread
parentfe533fb809197fe066a5a0587533ee5a3d81093a (diff)
Made most libraries panic on js targets instead of not compiling
Diffstat (limited to 'core/thread')
-rw-r--r--core/thread/thread_js.odin55
1 files changed, 55 insertions, 0 deletions
diff --git a/core/thread/thread_js.odin b/core/thread/thread_js.odin
new file mode 100644
index 000000000..909c07447
--- /dev/null
+++ b/core/thread/thread_js.odin
@@ -0,0 +1,55 @@
+//+build js
+package thread
+
+import "core:intrinsics"
+import "core:sync"
+import "core:mem"
+
+Thread_State :: enum u8 {
+ Started,
+ Joined,
+ Done,
+}
+
+Thread_Os_Specific :: struct {
+
+}
+
+_thread_priority_map := [Thread_Priority]i32{
+ .Normal = 0,
+ .Low = -2,
+ .High = +2,
+}
+
+_create :: proc(procedure: Thread_Proc, priority := Thread_Priority.Normal) -> ^Thread {
+ panic("core:thread procedure not supported on js target")
+}
+
+_start :: proc(t: ^Thread) {
+ panic("core:thread procedure not supported on js target")
+}
+
+_is_done :: proc(t: ^Thread) -> bool {
+ panic("core:thread procedure not supported on js target")
+}
+
+_join :: proc(t: ^Thread) {
+ panic("core:thread procedure not supported on js target")
+}
+
+_join_multiple :: proc(threads: ..^Thread) {
+ panic("core:thread procedure not supported on js target")
+}
+
+_destroy :: proc(thread: ^Thread) {
+ panic("core:thread procedure not supported on js target")
+}
+
+_terminate :: proc(using thread : ^Thread, exit_code: int) {
+ panic("core:thread procedure not supported on js target")
+}
+
+_yield :: proc() {
+ panic("core:thread procedure not supported on js target")
+}
+