File tree Expand file tree Collapse file tree 3 files changed +30
-6
lines changed Expand file tree Collapse file tree 3 files changed +30
-6
lines changed Original file line number Diff line number Diff line change 9
9
include :
10
10
- name : MRI 2.5.1 Latest
11
11
rvm : 2.5.1
12
- - name : JRuby 9.2.0.0 Latest
13
- rvm : jruby-9.2.0.0
12
+ - name : JRuby 9.2.4.1 Latest on Java 11
13
+ rvm : jruby-9.2.4.1
14
+ jdk : oraclejdk11
15
+ - name : JRuby 9.2.4.1 Latest on Java 8
16
+ rvm : jruby-9.2.4.1
14
17
jdk : oraclejdk8
15
18
- name : TruffleRuby Latest
16
19
rvm : system
Original file line number Diff line number Diff line change @@ -23,18 +23,29 @@ JRUBY_JAR_PATH = '/usr/local/opt/rbenv/versions/jruby-9.1.17.0/lib/jruby.jar'
23
23
class ConcurrentRubyJavaExtensionTask < Rake ::JavaExtensionTask
24
24
def java_classpath_arg ( *args )
25
25
jruby_cpath = nil
26
+
26
27
if RUBY_PLATFORM =~ /java/
27
28
begin
28
29
cpath = Java ::java . lang . System . getProperty ( 'java.class.path' ) . split ( File ::PATH_SEPARATOR )
29
30
cpath += Java ::java . lang . System . getProperty ( 'sun.boot.class.path' ) . split ( File ::PATH_SEPARATOR )
30
31
jruby_cpath = cpath . compact . join ( File ::PATH_SEPARATOR )
31
32
rescue => e
32
33
end
34
+
35
+ unless jruby_cpath
36
+ libdir = RbConfig ::CONFIG [ 'libdir' ]
37
+ if libdir . start_with? "classpath:"
38
+ raise 'Cannot build with jruby-complete'
39
+ end
40
+ jruby_cpath = File . join ( libdir , "jruby.jar" )
41
+ end
33
42
end
43
+
34
44
unless jruby_cpath
35
45
jruby_cpath = JRUBY_JAR_PATH
36
46
raise "#{ jruby_cpath } does not exist" unless File . exist? jruby_cpath
37
47
end
48
+
38
49
jruby_cpath += File ::PATH_SEPARATOR + args . join ( File ::PATH_SEPARATOR ) unless args . empty?
39
50
jruby_cpath ? "-cp \" #{ jruby_cpath } \" " : ""
40
51
end
Original file line number Diff line number Diff line change @@ -181,10 +181,20 @@ def ns_initialize
181
181
182
182
specify 'final field always visible' do
183
183
store = BClass . new 'asd'
184
- t1 = in_thread { 1000000000 . times { |i | store = BClass . new i . to_s } }
185
- t2 = in_thread { 10 . times { expect ( store . final ) . not_to be_nil ; Thread . pass } }
186
- t2 . join
187
- t1 . kill
184
+ done = CountDownLatch . new
185
+ in_thread do
186
+ 1000000000 . times do |i |
187
+ store = BClass . new i . to_s
188
+ break if done . count == 0
189
+ end
190
+ end
191
+ in_thread do
192
+ 10 . times do
193
+ expect ( store . final ) . not_to be_nil
194
+ Thread . pass
195
+ end
196
+ done . count_down
197
+ end
188
198
end
189
199
190
200
let ( :store ) { BClass . new }
You can’t perform that action at this time.
0 commit comments