Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix timeout events getting lost on Windows #13525

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/crystal/system/event_loop.cr
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ abstract class Crystal::EventLoop
# Creates a timeout_event.
abstract def create_timeout_event(fiber : Fiber) : Event

abstract struct Event
module Event
# Frees the event.
abstract def free : Nil

Expand Down
4 changes: 3 additions & 1 deletion src/crystal/system/unix/event_libevent.cr
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ require "./lib_event2"
{% end %}

# :nodoc:
struct Crystal::LibEvent::Event < Crystal::EventLoop::Event
struct Crystal::LibEvent::Event
include Crystal::EventLoop::Event

VERSION = String.new(LibEvent2.event_get_version)

def self.callback(&block : Int32, LibEvent2::EventFlags, Void* ->)
Expand Down
4 changes: 3 additions & 1 deletion src/crystal/system/wasi/event_loop.cr
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ class Crystal::Wasi::EventLoop < Crystal::EventLoop
end
end

struct Crystal::Wasi::Event < Crystal::EventLoop::Event
struct Crystal::Wasi::Event
include Crystal::EventLoop::Event

def add(timeout : Time::Span?) : Nil
end

Expand Down
4 changes: 3 additions & 1 deletion src/crystal/system/win32/event_loop_iocp.cr
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@ class Crystal::Iocp::EventLoop < Crystal::EventLoop
end
end

struct Crystal::Iocp::Event < Crystal::EventLoop::Event
class Crystal::Iocp::Event
include Crystal::EventLoop::Event

getter fiber
getter wake_at
getter? timeout
Expand Down