-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathThreadAssert.gd
More file actions
45 lines (34 loc) · 855 Bytes
/
Copy pathThreadAssert.gd
File metadata and controls
45 lines (34 loc) · 855 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
extends Node
var typed: int
func _ready():
var thread = Thread.new()
thread.start(_thread_function)
raise_error_demo()
thread.wait_to_finish()
thread.free()
func raise_error_demo():
var bad = Thread.new()
bad.free()
bad.get_id()
func bar():
var worker_thread_only_var: int = 1
var another_worker_thread_only_var: int = 2
var _ignored = worker_thread_only_var
_ignored = another_worker_thread_only_var
# assert(typed > 0, "this was only shown on stderr before, with no indication in the Editor")
OS.delay_msec(1000)
breakpoint
OS.delay_msec(1000)
breakpoint
OS.delay_msec(1000)
breakpoint
func foo():
var worker_thread_foo_var: int = 1
bar()
var _ignored = worker_thread_foo_var
# bad call
_ignored.free()
func _thread_function():
var worker_thread_fun_var: int = 1
foo()
var _ignored = worker_thread_fun_var