Skip to content

TimerSet doesn't pop any timers until the first timer pops #216

Closed
@rkday

Description

@rkday
$ cat timer_set_bug_test.rb 
require 'concurrent'

puts Time.now

Concurrent::timer(12) { puts Time.now }

sleep 1

Concurrent::timer(6) { puts Time.now }

sleep 15

I'd expect this to print three timestamps, each 6 seconds apart. Instead, the six-second timer doesn't fire until after the twelve-second timer:

$ ruby timer_set_bug_test.rb 
2015-01-01 11:15:39 +0000
2015-01-01 11:15:51 +0000
2015-01-01 11:15:51 +0000

I'm pretty confident that I can see the issue (we never signal the condvar), so I'm preparing a patch now.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions