Skip to content

Commit 0f112bd

Browse files
committed
Updated all scripts in examples.
1 parent 0e3fdc4 commit 0f112bd

9 files changed

+35
-389
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,4 @@ ext/**/*.bundle
3535
ext/**/*.so
3636
ext/**/*.jar
3737
pkg
38+
*.csv

examples/actor_stress_test.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ def test(threads, loops)
8484
expect(queue.pop).to eq 3
8585

8686
actor << :terminate!
87-
expect(actor.ask(:blow_up).wait).to be_rejected
87+
#expect(actor.ask(:blow_up).wait).to be_rejected
88+
expect(actor.ask(:blow_up).wait).to be_failed
8889
terminate_actors(actor, child)
8990
end
9091
end

examples/at_exit_tester.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
require 'concurrent'
66

77
# with this, a JRuby process will never exit
8-
Concurrent.disable_auto_termination_of_all_executors!
8+
Concurrent.disable_executor_auto_termination!
99

1010
SIZE = 5
1111

examples/atomic_example.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
$: << File.expand_path('../../lib', __FILE__)
44

5-
require 'concurrent/atomic'
5+
require 'concurrent/atomics'
66

7-
my_atomic = Concurrent::Atomic.new(0)
7+
my_atomic = Concurrent::AtomicReference.new(0)
88
my_atomic.update {|v| v + 1}
99
puts "new value: #{my_atomic.value}"
1010

examples/bench_atomic.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
require 'rbconfig'
77
require 'thread'
88

9-
require 'concurrent/atomic'
9+
require 'concurrent/atomics'
1010

11-
if RUBY_PLATFORM != 'java' && ! defined? Concurrent::CAtomic
11+
if RUBY_PLATFORM != 'java' && ! defined? Concurrent::CAtomicReference
1212
warn "[WARN] C extensions not loaded!"
1313
end
1414

@@ -24,10 +24,10 @@
2424

2525
# list of platform-specific implementations
2626
ATOMICS = [
27-
'MutexAtomic',
28-
'CAtomic',
29-
'JavaAtomic',
30-
'RbxAtomic',
27+
'MutexAtomicReference',
28+
'CAtomicReference',
29+
'JavaAtomicReference',
30+
'RbxAtomicReference',
3131
]
3232

3333
puts "Testing with #{RbConfig::CONFIG['ruby_install_name']} #{RUBY_VERSION}"

examples/bench_atomic_1.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
require 'thread'
77
require 'benchmark'
88

9-
require 'concurrent/atomic'
9+
require 'concurrent/atomics'
1010

11-
unless defined? Concurrent::CAtomic
11+
unless defined? Concurrent::CAtomicReference
1212
warn "[ERROR] C extensions not loaded!"
1313
exit(1)
1414
end

examples/benchmark_new_futures.rb

100644100755
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
#!/usr/bin/env ruby
2+
3+
$: << File.expand_path('../../lib', __FILE__)
4+
15
require 'benchmark/ips'
26
require 'concurrent'
37
require 'concurrent-edge'

0 commit comments

Comments
 (0)