concurrent-ruby 0.1.1.pre.1 → 0.1.1.pre.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -37,11 +37,15 @@ module Concurrent
37
37
  end
38
38
 
39
39
  def kill
40
- @thread.kill
41
- @thread = nil
40
+ unless @thread.nil?
41
+ atomic do
42
+ stop
43
+ Thread.kill(@thread)
44
+ @thread = nil
45
+ end
46
+ end
42
47
  end
43
48
  alias_method :terminate, :kill
44
- alias_method :stop, :kill
45
49
  end
46
50
 
47
51
  EXECUTION_INTERVAL = 60
@@ -64,7 +64,7 @@ module Concurrent
64
64
  end
65
65
 
66
66
  def stop_on_signal(*signals)
67
- signals.each{|signal| Signal.trap(signal){ self.stop } }
67
+ signals.each{|signal| Signal.trap(signal){ Thread.new{ self.stop }}}
68
68
  end
69
69
 
70
70
  def handle_event(event, *args)
@@ -1,3 +1,3 @@
1
1
  module Concurrent
2
- VERSION = '0.1.1.pre.1'
2
+ VERSION = '0.1.1.pre.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: concurrent-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1.pre.1
4
+ version: 0.1.1.pre.2
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-08-06 00:00:00.000000000 Z
12
+ date: 2013-08-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: functional-ruby