cool.io 1.4.6-x86-mingw32 → 1.5.3-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
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.3
5
5
  platform: x86-mingw32
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-11-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake-compiler
@@ -121,9 +121,7 @@ files:
121
121
  - ext/libev/ev_vars.h
122
122
  - ext/libev/ev_win32.c
123
123
  - ext/libev/ev_wrap.h
124
- - ext/libev/ruby_gil.patch
125
124
  - ext/libev/test_libev_win32.c
126
- - ext/libev/win_select.patch
127
125
  - lib/.gitignore
128
126
  - lib/2.0/cool.io_ext.so
129
127
  - lib/2.0/iobuffer_ext.so
@@ -150,6 +148,8 @@ files:
150
148
  - lib/cool.io/timer_watcher.rb
151
149
  - lib/cool.io/version.rb
152
150
  - lib/coolio.rb
151
+ - libev_ruby_gil.diff
152
+ - libev_win_select.diff
153
153
  - spec/async_watcher_spec.rb
154
154
  - spec/dns_spec.rb
155
155
  - spec/iobuffer_spec.rb
@@ -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 */