I'm working on updating a gem to be compatible with Ruby 2.0 and am
currently using Ruby 2.0.0-preview2. I'm running into trouble with a
class which inherits from GServer and I think it's related to this bug
and subsequent patch <https://bugs.ruby-lang.org/issues/6416>. Please
look at the gist:https://gist.github.com/4424479

Using Ruby <= 1.9.3, when sending an interrupt signal this code would
exit cleanly. Using Ruby 2.0, an exception is thrown on launcher.stop:

~/.rvm/rubies/ruby-2.0.0-preview2/lib/ruby/2.0.0/gserver.rb:116:in
`synchronize': can't be called from trap context (ThreadError)
    from
~/.rvm/rubies/ruby-2.0.0-preview2/lib/ruby/2.0.0/gserver.rb:116:in
`stop'

As you can see, I am not explicitly calling 'join' in the trap context
but 'synchronize' is called as part of GServer#close

gserver.rb
114   # Stop the server
115   def stop
116     @connectionsMutex.synchronize  {
117       if @tcpServerThread
118         @tcpServerThread.raise "stop"
119       end
120     }
121   end

I'm open to any ideas or suggestions. Thanks!