Skip to content

Commit fd6d402

Browse files
committed
more v0.2 compatibility fixes
1 parent 6963e5a commit fd6d402

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/GLib/signals.jl

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,16 +191,21 @@ end
191191
expiration = uint64(0)
192192
if VERSION < v"0.3-"
193193
isempty_workqueue() = isempty(Base.Workqueue) || (length(Base.Workqueue) == 1 && Base.Workqueue[1] == Base.roottask)
194+
function uv_loop_alive(evt)
195+
ccall(:uv_stop,Void,(Ptr{Void},),evt)
196+
ccall(:uv_run,Cint,(Ptr{Void},Cint),evt,2) != 0
197+
end
194198
else
195199
isempty_workqueue() = isempty(Base.Workqueue)
200+
uv_loop_alive(evt) = ccall(:uv_loop_alive,Cint,(Ptr{Void},),evt) != 0
196201
end
197202
function uv_prepare(src::Ptr{Void},timeout::Ptr{Cint})
198203
global expiration, uv_pollfd
199204
local tmout_ms::Cint
200205
evt = Base.eventloop()
201206
if !isempty_workqueue()
202207
tmout_ms = 0
203-
elseif ccall(:uv_loop_alive,Cint,(Ptr{Void},),evt) == 0
208+
elseif !uv_loop_alive(evt)
204209
tmout_ms = -1
205210
elseif uv_pollfd.revents != 0
206211
tmout_ms = 0
@@ -229,7 +234,7 @@ function uv_check(src::Ptr{Void})
229234
ex = expiration::Uint64
230235
if !isempty_workqueue()
231236
return int32(1)
232-
elseif ccall(:uv_loop_alive,Cint,(Ptr{Void},),Base.eventloop()) == 0
237+
elseif !uv_loop_alive(Base.eventloop())
233238
return int32(0)
234239
elseif ex == 0
235240
return int32(1)

0 commit comments

Comments
 (0)