nio4r 0.4.0-java → 0.4.1-java

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGES.md CHANGED
@@ -1,3 +1,7 @@
1
+ 0.4.1
2
+ -----
3
+ * Thread synchronization when closing selectors
4
+
1
5
  0.4.0
2
6
  -----
3
7
  * OpenSSL::SSL::SSLSocket support
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  New IO for Ruby
2
2
  ===============
3
- [![Build Status](http://travis-ci.org/tarcieri/nio4r.png)](http://travis-ci.org/tarcieri/nio4r)
3
+ [![Build Status](https://secure.travis-ci.org/tarcieri/nio4r.png?branch=master)](http://travis-ci.org/tarcieri/nio4r)
4
4
 
5
5
  When it comes to managing many IO objects on Ruby, there aren't a whole lot of
6
6
  options. The most powerful API Ruby itself gives you is Kernel.select, and
data/ext/nio4r/selector.c CHANGED
@@ -36,6 +36,8 @@ static VALUE NIO_Selector_unlock(VALUE lock);
36
36
  static VALUE NIO_Selector_register_synchronized(VALUE *args);
37
37
  static VALUE NIO_Selector_deregister_synchronized(VALUE *args);
38
38
  static VALUE NIO_Selector_select_synchronized(VALUE *args);
39
+ static VALUE NIO_Selector_close_synchronized(VALUE self);
40
+
39
41
  static int NIO_Selector_run(struct NIO_Selector *selector, VALUE timeout);
40
42
  static void NIO_Selector_timeout_callback(struct ev_loop *ev_loop, struct ev_timer *timer, int revents);
41
43
  static void NIO_Selector_wakeup_callback(struct ev_loop *ev_loop, struct ev_io *io, int revents);
@@ -389,7 +391,11 @@ static VALUE NIO_Selector_close(VALUE self)
389
391
  /* Is the selector closed? */
390
392
  static VALUE NIO_Selector_closed(VALUE self)
391
393
  {
392
- struct NIO_Selector *selector;
394
+ return NIO_Selector_synchronize(self, NIO_Selector_close_synchronized, self);
395
+ }
396
+
397
+ static VALUE NIO_Selector_close_synchronized(VALUE self)
398
+ { struct NIO_Selector *selector;
393
399
  Data_Get_Struct(self, struct NIO_Selector, selector);
394
400
 
395
401
  return selector->closed ? Qtrue : Qfalse;
data/lib/nio.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  require 'thread'
2
+ require 'socket'
2
3
  require 'nio/version'
3
4
 
4
5
  # New I/O for Ruby
@@ -19,9 +20,10 @@ else
19
20
 
20
21
  if defined?(JRUBY_VERSION)
21
22
  require 'java'
23
+ require 'jruby'
22
24
  org.nio4r.Nio4r.new.load(JRuby.runtime, false)
23
25
  NIO::ENGINE = 'java'
24
26
  else
25
27
  NIO::ENGINE = 'libev'
26
28
  end
27
- end
29
+ end
data/lib/nio/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module NIO
2
- VERSION = "0.4.0"
2
+ VERSION = "0.4.1"
3
3
  end
metadata CHANGED
@@ -2,46 +2,67 @@
2
2
  name: nio4r
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.4.0
5
+ version: 0.4.1
6
6
  platform: java
7
7
  authors:
8
8
  - Tony Arcieri
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-06-19 00:00:00.000000000Z
12
+ date: 2012-11-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake-compiler
16
- version_requirements: &2056 !ruby/object:Gem::Requirement
16
+ version_requirements: !ruby/object:Gem::Requirement
17
17
  requirements:
18
18
  - - ! '>='
19
19
  - !ruby/object:Gem::Version
20
- version: '0'
20
+ version: !binary |-
21
+ MA==
22
+ none: false
23
+ requirement: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ! '>='
26
+ - !ruby/object:Gem::Version
27
+ version: !binary |-
28
+ MA==
21
29
  none: false
22
- requirement: *2056
23
30
  prerelease: false
24
31
  type: :development
25
32
  - !ruby/object:Gem::Dependency
26
33
  name: rake
27
- version_requirements: &2074 !ruby/object:Gem::Requirement
34
+ version_requirements: !ruby/object:Gem::Requirement
35
+ requirements:
36
+ - - ! '>='
37
+ - !ruby/object:Gem::Version
38
+ version: !binary |-
39
+ MA==
40
+ none: false
41
+ requirement: !ruby/object:Gem::Requirement
28
42
  requirements:
29
43
  - - ! '>='
30
44
  - !ruby/object:Gem::Version
31
- version: '0'
45
+ version: !binary |-
46
+ MA==
32
47
  none: false
33
- requirement: *2074
34
48
  prerelease: false
35
49
  type: :development
36
50
  - !ruby/object:Gem::Dependency
37
51
  name: rspec
38
- version_requirements: &2090 !ruby/object:Gem::Requirement
52
+ version_requirements: !ruby/object:Gem::Requirement
53
+ requirements:
54
+ - - ! '>='
55
+ - !ruby/object:Gem::Version
56
+ version: !binary |-
57
+ MA==
58
+ none: false
59
+ requirement: !ruby/object:Gem::Requirement
39
60
  requirements:
40
61
  - - ! '>='
41
62
  - !ruby/object:Gem::Version
42
- version: '0'
63
+ version: !binary |-
64
+ MA==
43
65
  none: false
44
- requirement: *2090
45
66
  prerelease: false
46
67
  type: :development
47
68
  description: New IO for Ruby
@@ -109,17 +130,25 @@ required_ruby_version: !ruby/object:Gem::Requirement
109
130
  requirements:
110
131
  - - ! '>='
111
132
  - !ruby/object:Gem::Version
112
- version: '0'
133
+ segments:
134
+ - 0
135
+ hash: 2
136
+ version: !binary |-
137
+ MA==
113
138
  none: false
114
139
  required_rubygems_version: !ruby/object:Gem::Requirement
115
140
  requirements:
116
141
  - - ! '>='
117
142
  - !ruby/object:Gem::Version
118
- version: '0'
143
+ segments:
144
+ - 0
145
+ hash: 2
146
+ version: !binary |-
147
+ MA==
119
148
  none: false
120
149
  requirements: []
121
150
  rubyforge_project:
122
- rubygems_version: 1.8.15
151
+ rubygems_version: 1.8.24
123
152
  signing_key:
124
153
  specification_version: 3
125
154
  summary: NIO provides a high performance selector API for monitoring IO objects
@@ -133,4 +162,3 @@ test_files:
133
162
  - spec/nio/selector_spec.rb
134
163
  - spec/spec_helper.rb
135
164
  - spec/support/selectable_examples.rb
136
- ...