Skip to content

Instantly share code, notes, and snippets.

@mpage
Created January 6, 2012 21:45
Show Gist options
  • Save mpage/1572539 to your computer and use it in GitHub Desktop.
Save mpage/1572539 to your computer and use it in GitHub Desktop.
> ruby /tmp/flock_test.rb
2012-01-06 13:42:23 -0800 #<Thread:0x0000000159fe88> -- Acquiring lock
2012-01-06 13:42:23 -0800 #<Thread:0x0000000159fd98> -- Acquiring lock
2012-01-06 13:42:23 -0800 #<Thread:0x0000000159fca8> -- Still active
2012-01-06 13:42:23 -0800 #<Thread:0x0000000159fe88> -- Acquired lock
2012-01-06 13:42:23 -0800 #<Thread:0x0000000159fe88> -- Sleeping 10
2012-01-06 13:42:24 -0800 #<Thread:0x0000000159fca8> -- Still active
2012-01-06 13:42:25 -0800 #<Thread:0x0000000159fca8> -- Still active
2012-01-06 13:42:26 -0800 #<Thread:0x0000000159fca8> -- Still active
2012-01-06 13:42:27 -0800 #<Thread:0x0000000159fca8> -- Still active
2012-01-06 13:42:28 -0800 #<Thread:0x0000000159fca8> -- Still active
2012-01-06 13:42:29 -0800 #<Thread:0x0000000159fca8> -- Still active
2012-01-06 13:42:30 -0800 #<Thread:0x0000000159fca8> -- Still active
2012-01-06 13:42:31 -0800 #<Thread:0x0000000159fca8> -- Still active
2012-01-06 13:42:32 -0800 #<Thread:0x0000000159fca8> -- Still active
2012-01-06 13:42:33 -0800 #<Thread:0x0000000159fd98> -- Acquired lock
2012-01-06 13:42:33 -0800 #<Thread:0x0000000159fd98> -- Sleeping 10
2012-01-06 13:42:33 -0800 #<Thread:0x0000000159fca8> -- Still active
2012-01-06 13:42:34 -0800 #<Thread:0x0000000159fca8> -- Still active
2012-01-06 13:42:35 -0800 #<Thread:0x0000000159fca8> -- Still active
2012-01-06 13:42:36 -0800 #<Thread:0x0000000159fca8> -- Still active
2012-01-06 13:42:37 -0800 #<Thread:0x0000000159fca8> -- Still active
2012-01-06 13:42:38 -0800 #<Thread:0x0000000159fca8> -- Still active
2012-01-06 13:42:39 -0800 #<Thread:0x0000000159fca8> -- Still active
2012-01-06 13:42:40 -0800 #<Thread:0x0000000159fca8> -- Still active
2012-01-06 13:42:41 -0800 #<Thread:0x0000000159fca8> -- Still active
2012-01-06 13:42:42 -0800 #<Thread:0x0000000159fca8> -- Still active
>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment