cool.io 1.4.6 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cool.io
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.6
4
+ version: 1.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tony Arcieri
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-01-24 00:00:00.000000000 Z
12
+ date: 2017-04-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake-compiler
@@ -123,9 +123,7 @@ files:
123
123
  - ext/libev/ev_vars.h
124
124
  - ext/libev/ev_win32.c
125
125
  - ext/libev/ev_wrap.h
126
- - ext/libev/ruby_gil.patch
127
126
  - ext/libev/test_libev_win32.c
128
- - ext/libev/win_select.patch
129
127
  - lib/.gitignore
130
128
  - lib/cool.io.rb
131
129
  - lib/cool.io/async_watcher.rb
@@ -142,6 +140,8 @@ files:
142
140
  - lib/cool.io/timer_watcher.rb
143
141
  - lib/cool.io/version.rb
144
142
  - lib/coolio.rb
143
+ - libev_ruby_gil.diff
144
+ - libev_win_select.diff
145
145
  - spec/async_watcher_spec.rb
146
146
  - spec/dns_spec.rb
147
147
  - spec/iobuffer_spec.rb
@@ -172,7 +172,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
172
172
  version: '0'
173
173
  requirements: []
174
174
  rubyforge_project:
175
- rubygems_version: 2.6.8
175
+ rubygems_version: 2.6.11
176
176
  signing_key:
177
177
  specification_version: 4
178
178
  summary: A cool framework for doing high performance I/O in Ruby
@@ -1,97 +0,0 @@
1
- diff --git a/ext/libev/ev.c b/ext/libev/ev.c
2
- index e5bd5ab..10f6ff2 100644
3
- --- a/ext/libev/ev.c
4
- +++ b/ext/libev/ev.c
5
- @@ -37,6 +37,10 @@
6
- * either the BSD or the GPL.
7
- */
8
-
9
- +/* ########## COOLIO PATCHERY HO! ########## */
10
- +#include "ruby.h"
11
- +/* ######################################## */
12
- +
13
- /* this big block deduces configuration from config.h */
14
- #ifndef EV_STANDALONE
15
- # ifdef EV_CONFIG_H
16
- @@ -3237,9 +3241,27 @@ time_update (EV_P_ ev_tstamp max_block)
17
- }
18
- }
19
-
20
- +/* ########## COOLIO PATCHERY HO! ########## */
21
- +#if defined(HAVE_RB_THREAD_BLOCKING_REGION)
22
- +static
23
- +VALUE ev_backend_poll(void **args)
24
- +{
25
- + struct ev_loop *loop = (struct ev_loop *)args[0];
26
- + ev_tstamp waittime = *(ev_tstamp *)args[1];
27
- + backend_poll (EV_A_ waittime);
28
- +}
29
- +#endif
30
- +/* ######################################## */
31
- +
32
- int
33
- ev_run (EV_P_ int flags)
34
- {
35
- +/* ########## COOLIO PATCHERY HO! ########## */
36
- +#if defined(HAVE_RB_THREAD_BLOCKING_REGION)
37
- + void *poll_args[2];
38
- +#endif
39
- +/* ######################################## */
40
- +
41
- #if EV_FEATURE_API
42
- ++loop_depth;
43
- #endif
44
- @@ -3357,7 +3379,53 @@ ev_run (EV_P_ int flags)
45
- ++loop_count;
46
- #endif
47
- assert ((loop_done = EVBREAK_RECURSE, 1)); /* assert for side effect */
48
- +
49
- +/*
50
- +########################## COOLIO PATCHERY HO! ##########################
51
- +
52
- +The original patch file is made by Tony Arcieri.
53
- +https://github.com/celluloid/nio4r/blob/680143345726c5a64bb22376ca8fc3c6857019ae/ext/libev/ruby_gil.patch.
54
- +
55
- +According to the grandwizards of Ruby, locking and unlocking of the global
56
- +interpreter lock are apparently too powerful a concept for a mere mortal to
57
- +wield (although redefining what + and - do to numbers is totally cool).
58
- +And so it came to pass that the only acceptable way to release the global
59
- +interpreter lock is through a convoluted callback system that thakes a
60
- +function pointer. While the grandwizard of libev foresaw this sort of scenario,
61
- +he too attempted to place an API with callbacks on it, one that runs before
62
- +the system call, and one that runs immediately after.
63
- +
64
- +And so it came to pass that trying to wrap everything up in callbacks created
65
- +two incompatible APIs, Ruby's which releases the global interpreter lock and
66
- +reacquires it when the callback returns, and libev's, which wants two
67
- +callbacks, one which runs before the polling operation starts, and one which
68
- +runs after it finishes.
69
- +
70
- +These two systems are incompatible as they both want to use callbacks to
71
- +solve the same problem, however libev wants to use before/after callbacks,
72
- +and Ruby wants to use an "around" callback. This presents a significant
73
- +problem as these two patterns of callbacks are diametrical opposites of each
74
- +other and thus cannot be composed.
75
- +
76
- +And thus we are left with no choice but to patch the internals of libev in
77
- +order to release a mutex at just the precise moment.
78
- +
79
- +Let this be a lesson to the all: CALLBACKS FUCKING BLOW
80
- +
81
- +#######################################################################
82
- +*/
83
- +
84
- +#if defined(HAVE_RB_THREAD_BLOCKING_REGION)
85
- + poll_args[0] = (void *)loop;
86
- + poll_args[1] = (void *)&waittime;
87
- + rb_thread_blocking_region(ev_backend_poll, (void *)&poll_args, RUBY_UBF_IO, 0);
88
- +#else
89
- backend_poll (EV_A_ waittime);
90
- +#endif
91
- +/*
92
- +############################# END PATCHERY ############################
93
- +*/
94
- +
95
- assert ((loop_done = EVBREAK_CANCEL, 1)); /* assert for side effect */
96
-
97
- pipe_write_wanted = 0; /* just an optimisation, no fence needed */