io-event 1.7.2 → 1.7.4

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: 00ee9c58a1f3c352028955bd7fa687b868a38d658f076ed128999e434a50e67f
4
- data.tar.gz: 8bb4a29b1f992e2fdf5b155e8efb1361e70cf1a635bbcac75723d6e255b27d92
3
+ metadata.gz: 9761a366e91db284c56c77d2ec19db8b6d652d98f2fe39750108e685ff3c2b12
4
+ data.tar.gz: 3d9d1fab942ec257073a317cecefb06248952e5e7c2518f0298d60b476ec1905
5
5
  SHA512:
6
- metadata.gz: 6882b4c368d9b5e1fd32d3545409d311db6d5624ae9353f1112c0f3960a85e62685aaa05ff9a20612c2e17bb8d286e1ce88be5024ed0d343713c8ddf378f9d05
7
- data.tar.gz: be96ca6107b200375af43eefad3b549eff15a7e4ad90798fb695c20dcd711f557b405a9c8f36d40324531ab92f03e1dbbaadb07419d7091ae7f6247567573877
6
+ metadata.gz: 4e7c4790ad17bb655136e1ce25b006c4bc97906b7b46eac2abddddd100eb882d19569da27ae195455b457ea3f243bd8ebe6475a9d0255f1bd11bf33cf66edd15
7
+ data.tar.gz: 00b9bc9c8ad79828b50b67fdf9fb9a9d25664fb5d9b8c77eb70aa708ee719974b07ba6ed4c3098d76c9b33132061070d36bc39c2c5c707448a9400cef0f2a4ed
checksums.yaml.gz.sig CHANGED
Binary file
@@ -8,10 +8,8 @@
8
8
  #include <errno.h>
9
9
  #include <assert.h>
10
10
 
11
- enum {
12
- IO_EVENT_ARRAY_MAXIMUM_COUNT = SIZE_MAX / sizeof(void*),
13
- IO_EVENT_ARRAY_DEFAULT_COUNT = 128
14
- };
11
+ static const size_t IO_EVENT_ARRAY_MAXIMUM_COUNT = SIZE_MAX / sizeof(void*);
12
+ static const size_t IO_EVENT_ARRAY_DEFAULT_COUNT = 128;
15
13
 
16
14
  struct IO_Event_Array {
17
15
  // The array of pointers to elements:
@@ -504,6 +504,13 @@ VALUE IO_Event_Selector_EPoll_process_wait(VALUE self, VALUE fiber, VALUE _pid,
504
504
 
505
505
  rb_update_max_fd(descriptor);
506
506
 
507
+ // `pidfd_open` (above) may be edge triggered, so we need to check if the process is already exited, and if so, return immediately, otherwise we will block indefinitely.
508
+ VALUE status = IO_Event_Selector_process_status_wait(pid, flags);
509
+ if (status != Qnil) {
510
+ close(descriptor);
511
+ return status;
512
+ }
513
+
507
514
  struct IO_Event_Selector_EPoll_Waiting waiting = {
508
515
  .list = {.type = &IO_Event_Selector_EPoll_process_wait_list_type},
509
516
  .fiber = fiber,
@@ -461,6 +461,7 @@ void process_prewait(pid_t pid) {
461
461
  result = waitid(P_PID, pid, &info, WEXITED | WNOWAIT);
462
462
  // This can sometimes get interrupted by SIGCHLD.
463
463
  } while (result == -1 && errno == EINTR);
464
+
464
465
  if (result == -1) {
465
466
  rb_sys_fail("process_prewait:waitid");
466
467
  }
@@ -233,6 +233,8 @@ VALUE IO_Event_Selector_resume(struct IO_Event_Selector *backend, int argc, VALU
233
233
  .fiber = rb_fiber_current()
234
234
  };
235
235
 
236
+ RB_OBJ_WRITTEN(backend->self, Qundef, waiting.fiber);
237
+
236
238
  queue_push(backend, &waiting);
237
239
 
238
240
  struct wait_and_transfer_arguments arguments = {
@@ -266,6 +268,8 @@ VALUE IO_Event_Selector_raise(struct IO_Event_Selector *backend, int argc, VALUE
266
268
  .fiber = rb_fiber_current()
267
269
  };
268
270
 
271
+ RB_OBJ_WRITTEN(backend->self, Qundef, waiting.fiber);
272
+
269
273
  queue_push(backend, &waiting);
270
274
 
271
275
  struct wait_and_transfer_arguments arguments = {
@@ -5,6 +5,6 @@
5
5
 
6
6
  class IO
7
7
  module Event
8
- VERSION = "1.7.2"
8
+ VERSION = "1.7.4"
9
9
  end
10
10
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: io-event
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.2
4
+ version: 1.7.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
@@ -45,7 +45,7 @@ cert_chain:
45
45
  Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
46
46
  voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
47
47
  -----END CERTIFICATE-----
48
- date: 2024-10-16 00:00:00.000000000 Z
48
+ date: 2024-11-24 00:00:00.000000000 Z
49
49
  dependencies: []
50
50
  description:
51
51
  email:
@@ -104,7 +104,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
104
104
  - !ruby/object:Gem::Version
105
105
  version: '0'
106
106
  requirements: []
107
- rubygems_version: 3.5.11
107
+ rubygems_version: 3.5.22
108
108
  signing_key:
109
109
  specification_version: 4
110
110
  summary: An event loop.
metadata.gz.sig CHANGED
Binary file