Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: a560b2ecb20d
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 540b6354adf5
Choose a head ref
  • 2 commits
  • 1 file changed
  • 2 contributors

Commits on Dec 10, 2014

  1. Copy the full SHA
    c7e89ec View commit details

Commits on Dec 11, 2014

  1. Merge pull request #2303 from tduehr/ffi_spec_change

    fix blocking function call spec in ffi
    nirvdrum committed Dec 11, 2014
    Copy the full SHA
    540b635 View commit details
Showing with 9 additions and 6 deletions.
  1. +9 −6 spec/ffi/function_spec.rb
15 changes: 9 additions & 6 deletions spec/ffi/function_spec.rb
Original file line number Diff line number Diff line change
@@ -63,12 +63,15 @@ class << self; self; end
end

it 'can wrap a blocking function' do
# fp = FFI::Function.new(:void, [ :int ], @libtest.find_function('testBlocking'), :blocking => true)
# time = Time.now
# threads = []
# threads << Thread.new { fp.call(2) }
# threads << Thread.new(time) { expect(Time.now - time).to be < 1 }
# threads.each { |t| t.join }
fp = FFI::Function.new(:void, [ :int ], @libtest.find_function('testBlocking'), :blocking => true)
threads = 10.times.map do |x|
Thread.new do
time = Time.now
fp.call(2)
expect(Time.now - time).to be > 2
end
end
threads.each { |t| t.join }
end

it 'autorelease flag is set to true by default' do