Skip to content

Commit

Permalink
Merge pull request #142 from cdsousa/fixheartbeat
Browse files Browse the repository at this point in the history
Fix heartbeat pthread_create segmentation fault
  • Loading branch information
stevengj committed Feb 4, 2014
2 parents 4af3267 + caa4396 commit 5a09e17
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/heartbeat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ function heartbeat_thread(sock::Ptr{Void})
2, sock, sock)
nothing # not correct on Windows, but irrelevant since we never return
end
heartbeat_c = cfunction(heartbeat_thread, Void, (Ptr{Void},))

if @windows? false : true
const threadid = Array(Int, 128) # sizeof(pthread_t) is <= 8 on Linux & OSX
end

function start_heartbeat(sock)
heartbeat_c = cfunction(heartbeat_thread, Void, (Ptr{Void},))
@windows? begin
ccall(:_beginthread, Int, (Ptr{Void}, Cuint, Ptr{Void}),
heartbeat_c, 0, sock.data)
Expand Down

0 comments on commit 5a09e17

Please sign in to comment.