@@ -23,6 +23,11 @@ function lock!(l::TatasLock)
23
23
end
24
24
end
25
25
ccall (:jl_cpu_pause , Void, ())
26
+ # Temporary solution before we have gc transition support in codegen.
27
+ # This could mess up gc state when we add codegen support.
28
+ # Use these as a safe point
29
+ gc_state = ccall (:jl_gc_safe_enter , Int8, ())
30
+ ccall (:jl_gc_safe_leave , Void, (Int8,), gc_state)
26
31
end
27
32
end
28
33
@@ -61,6 +66,11 @@ function lock!(l::RecursiveTatasLock)
61
66
end
62
67
end
63
68
ccall (:jl_cpu_pause , Void, ())
69
+ # Temporary solution before we have gc transition support in codegen.
70
+ # This could mess up gc state when we add codegen support.
71
+ # Use these as a safe point
72
+ gc_state = ccall (:jl_gc_safe_enter , Int8, ())
73
+ ccall (:jl_gc_safe_leave , Void, (Int8,), gc_state)
64
74
end
65
75
end
66
76
@@ -116,7 +126,11 @@ function lock!(m::Mutex)
116
126
if m. ownertid == threadid ()
117
127
return 0
118
128
end
129
+ # Temporary solution before we have gc transition support in codegen.
130
+ # This could mess up gc state when we add codegen support.
131
+ gc_state = ccall (:jl_gc_safe_enter , Int8, ())
119
132
ccall (:uv_mutex_lock , Void, (Ptr{Void},), m. handle)
133
+ ccall (:jl_gc_safe_leave , Void, (Int8,), gc_state)
120
134
m. ownertid = threadid ()
121
135
return 0
122
136
end
0 commit comments