aboutsummaryrefslogtreecommitdiff
path: root/tests/core/thread
diff options
context:
space:
mode:
authorlaytan <laytanlaats@hotmail.com>2023-11-20 21:23:12 +0100
committerlaytan <laytanlaats@hotmail.com>2023-11-20 21:23:12 +0100
commit2e64866838e6d99387bbcaf272fdeaf063b1a308 (patch)
tree5ad1de8e07e44605fb2909b4055881525c1b7741 /tests/core/thread
parent50f86dc14f0575efb52d93953f611157e1026453 (diff)
fix self_cleanup causing join to fail
Diffstat (limited to 'tests/core/thread')
-rw-r--r--tests/core/thread/test_core_thread.odin16
1 files changed, 10 insertions, 6 deletions
diff --git a/tests/core/thread/test_core_thread.odin b/tests/core/thread/test_core_thread.odin
index 441b2187f..c0c7396a7 100644
--- a/tests/core/thread/test_core_thread.odin
+++ b/tests/core/thread/test_core_thread.odin
@@ -47,8 +47,9 @@ poly_data_test :: proc(_t: ^testing.T) {
t1 := thread.create_and_start_with_poly_data(b, proc(b: [MAX]byte) {
b_expect: [MAX]byte = 8
expect(poly_data_test_t, b == b_expect, "thread poly data not correct")
- }, self_cleanup = true)
-
+ })
+ defer free(t1)
+
b1: [3]uintptr = 1
b2: [MAX / 2]byte = 3
t2 := thread.create_and_start_with_poly_data2(b1, b2, proc(b: [3]uintptr, b2: [MAX / 2]byte) {
@@ -56,7 +57,8 @@ poly_data_test :: proc(_t: ^testing.T) {
b2_expect: [MAX / 2]byte = 3
expect(poly_data_test_t, b == b_expect, "thread poly data not correct")
expect(poly_data_test_t, b2 == b2_expect, "thread poly data not correct")
- }, self_cleanup = true)
+ })
+ defer free(t2)
t3 := thread.create_and_start_with_poly_data3(b1, b2, uintptr(333), proc(b: [3]uintptr, b2: [MAX / 2]byte, b3: uintptr) {
b_expect: [3]uintptr = 1
@@ -65,8 +67,9 @@ poly_data_test :: proc(_t: ^testing.T) {
expect(poly_data_test_t, b == b_expect, "thread poly data not correct")
expect(poly_data_test_t, b2 == b2_expect, "thread poly data not correct")
expect(poly_data_test_t, b3 == 333, "thread poly data not correct")
- }, self_cleanup = true)
-
+ })
+ defer free(t3)
+
t4 := thread.create_and_start_with_poly_data4(uintptr(111), b1, uintptr(333), u8(5), proc(n: uintptr, b: [3]uintptr, n2: uintptr, n4: u8) {
b_expect: [3]uintptr = 1
@@ -74,7 +77,8 @@ poly_data_test :: proc(_t: ^testing.T) {
expect(poly_data_test_t, b == b_expect, "thread poly data not correct")
expect(poly_data_test_t, n2 == 333, "thread poly data not correct")
expect(poly_data_test_t, n4 == 5, "thread poly data not correct")
- }, self_cleanup = true)
+ })
+ defer free(t4)
thread.join_multiple(t1, t2, t3, t4)
}