# File lib/connection/netio.rb, line 12 def _interruptible_gets(read_socket) # The gets thread may be interrupted by the heartbeat thread. Ensure that # if so interrupted, a new gets cannot start until after the heartbeat # thread finishes its work. This is PURELY to avoid a segfault bug # involving OpenSSL::Buffer. @gets_semaphore.synchronize { @getst = Thread.current } read_socket.gets ensure @gets_semaphore.synchronize { @getst = nil } end