async 2.4.0 → 2.4.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '0496bec665a4c9cb59cc9f52e0f75e8c122ff66b2daddaa0aa6e83022e5e8928'
4
- data.tar.gz: 2e0c3995dc1de72fee48942eecf96b14fa08f8e0d78083fba96be455a0ffdeab
3
+ metadata.gz: e0734cd025e0357960356ceac7c51d2a3c33efe60f62fcd0ab3d09a528866d7b
4
+ data.tar.gz: b9658e9b523e90a8d863c2f52cbf4fc8492fe42e6cc63422cb9af2af50582362
5
5
  SHA512:
6
- metadata.gz: cac34c61bf2bde2775d0abbf4185fdecc07f6540ba18017c90ce38ef6d72d95397e09c65b8d9f25f8e3a1ead9635180b38d6666525c00384810c796c6c92d629
7
- data.tar.gz: 39778867ad4784cf5f44d164f2d97f52d2cc43b869f267242ef5d9d588f626cc656bb01d7f935a8237f9f83ff50bf9b1371032f50ffb5bc39a1af80e2be89adc
6
+ metadata.gz: 0436e9692d113d2ee40e76e3c792f7ae81a7c563bc93cfe04470fcb84c610795d49a35dfaffa4f7c7f62d2b20efe316d796ca1a573bd997f654db5ba55f9f07a
7
+ data.tar.gz: 031eab57b8164cd1aa040a4e10d509d3c32db61331cda40c9a5689ef49b199f1d107e0edc154aa2bd5377ea848e0bdaf943b14ba3d3f5d30619c5dcef5ec496a
checksums.yaml.gz.sig CHANGED
Binary file
@@ -50,9 +50,12 @@ module Async
50
50
  # We depend on GVL for consistency:
51
51
  # @guard.synchronize do
52
52
 
53
- @selector&.close
53
+ # We want `@selector = nil` to be a visible side effect from this point forward, specifically in `#interrupt` and `#unblock`. If the selector is closed, then we don't want to push any fibers to it.
54
+ selector = @selector
54
55
  @selector = nil
55
56
 
57
+ selector&.close
58
+
56
59
  # end
57
60
 
58
61
  consume
@@ -69,9 +72,10 @@ module Async
69
72
  end
70
73
 
71
74
  # Interrupt the event loop and cause it to exit.
75
+ # @asynchronous May be called from any thread.
72
76
  def interrupt
73
77
  @interrupted = true
74
- @selector.wakeup
78
+ @selector&.wakeup
75
79
  end
76
80
 
77
81
  # Transfer from the calling fiber to the event loop.
@@ -127,8 +131,10 @@ module Async
127
131
  # $stderr.puts "unblock(#{blocker}, #{fiber})"
128
132
 
129
133
  # This operation is protected by the GVL:
130
- @selector.push(fiber)
131
- @selector.wakeup
134
+ if selector = @selector
135
+ selector.push(fiber)
136
+ selector.wakeup
137
+ end
132
138
  end
133
139
 
134
140
  # @asynchronous May be non-blocking..
data/lib/async/version.rb CHANGED
@@ -4,5 +4,5 @@
4
4
  # Copyright, 2017-2022, by Samuel Williams.
5
5
 
6
6
  module Async
7
- VERSION = "2.4.0"
7
+ VERSION = "2.4.1"
8
8
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: async
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.0
4
+ version: 2.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
@@ -56,7 +56,7 @@ cert_chain:
56
56
  Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
57
57
  voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
58
58
  -----END CERTIFICATE-----
59
- date: 2023-03-01 00:00:00.000000000 Z
59
+ date: 2023-03-07 00:00:00.000000000 Z
60
60
  dependencies:
61
61
  - !ruby/object:Gem::Dependency
62
62
  name: console
metadata.gz.sig CHANGED
Binary file