Skip to content

Instantly share code, notes, and snippets.

@Malet
Created October 13, 2015 09:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Malet/14700be9131b9fa5c45b to your computer and use it in GitHub Desktop.
Save Malet/14700be9131b9fa5c45b to your computer and use it in GitHub Desktop.
Threadsafe puts
def tputs(*params)
$io_lock ||= Mutex.new
$io_lock.synchronize{ puts(*params) }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment