thread_js.odin 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. //+build js
  2. package thread
  3. import "core:intrinsics"
  4. import "core:sync"
  5. import "core:mem"
  6. Thread_State :: enum u8 {
  7. Started,
  8. Joined,
  9. Done,
  10. }
  11. Thread_Os_Specific :: struct {
  12. flags: bit_set[Thread_State; u8],
  13. }
  14. _thread_priority_map := [Thread_Priority]i32{
  15. .Normal = 0,
  16. .Low = -2,
  17. .High = +2,
  18. }
  19. _create :: proc(procedure: Thread_Proc, priority := Thread_Priority.Normal) -> ^Thread {
  20. unimplemented("core:thread procedure not supported on js target")
  21. }
  22. _start :: proc(t: ^Thread) {
  23. unimplemented("core:thread procedure not supported on js target")
  24. }
  25. _is_done :: proc(t: ^Thread) -> bool {
  26. unimplemented("core:thread procedure not supported on js target")
  27. }
  28. _join :: proc(t: ^Thread) {
  29. unimplemented("core:thread procedure not supported on js target")
  30. }
  31. _join_multiple :: proc(threads: ..^Thread) {
  32. unimplemented("core:thread procedure not supported on js target")
  33. }
  34. _destroy :: proc(thread: ^Thread) {
  35. unimplemented("core:thread procedure not supported on js target")
  36. }
  37. _terminate :: proc(using thread : ^Thread, exit_code: int) {
  38. unimplemented("core:thread procedure not supported on js target")
  39. }
  40. _yield :: proc() {
  41. unimplemented("core:thread procedure not supported on js target")
  42. }