Sha256: 05389129d22d10bde8746508dc0f3ee3d7423b615fafe42198d0e74bc92b1f53

Contents?: true

Size: 496 Bytes

Versions: 1

Compression:

Stored size: 496 Bytes

Contents

require 'gir_ffi_test_helper'

describe "threading" do
  it "works while a MainLoop is running" do
    main_loop = GLib::MainLoop.new nil, false

    a = []
    GLib.timeout_add(GLib::PRIORITY_DEFAULT, 100,
                     proc { main_loop.quit },
                     nil, nil)

    slow_thread = Thread.new do
      sleep 0.001
      a << "During run"
    end

    a << "Before run"
    main_loop.run
    a << "After run"

    slow_thread.join

    a.last.must_equal "After run"
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
gir_ffi-0.7.6 test/integration/idle_loop_test.rb