Skip to content

Commit

Permalink
fixup! Fix: compilation with -Devloop_libevent
Browse files Browse the repository at this point in the history
  • Loading branch information
ysbaddaden committed Nov 4, 2024
1 parent 36ef33b commit 3777d73
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion spec/std/crystal/evented/arena_spec.cr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% skip_file unless flag?(:unix) %}
{% skip_file if !flag?(:unix) || flag?(:evloop_libevent) %}

require "spec"
require "../../../../src/crystal/system/unix/evented/arena"
Expand Down
2 changes: 1 addition & 1 deletion spec/std/crystal/evented/poll_descriptor_spec.cr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% skip_file unless flag?(:unix) %}
{% skip_file if !flag?(:unix) || flag?(:evloop_libevent) %}

require "spec"
require "../../../../src/crystal/system/unix/evented/poll_descriptor"
Expand Down
2 changes: 1 addition & 1 deletion spec/std/crystal/evented/timers_spec.cr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% skip_file unless flag?(:unix) %}
{% skip_file if !flag?(:unix) || flag?(:evloop_libevent) %}

require "spec"
require "../../../../src/crystal/system/unix/evented/timers"
Expand Down
2 changes: 1 addition & 1 deletion spec/std/crystal/evented/waiters_spec.cr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% skip_file unless flag?(:unix) %}
{% skip_file if !flag?(:unix) || flag?(:evloop_libevent) %}

require "spec"
require "../../../../src/crystal/system/unix/evented/waiters"
Expand Down
8 changes: 4 additions & 4 deletions src/io/evented.cr
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ module IO::Evented
end

private def add_read_event(timeout = @read_timeout) : Nil
event = @read_event.get { Crystal::EventLoop.current.as(Crystal::LibEvent::EventLoop).create_fd_read_event(self) }
event.as(Crystal::LibEvent::Event).add timeout
event = @read_event.get { Crystal::EventLoop.current.create_fd_read_event(self) }
event.add timeout
end

# :nodoc:
Expand All @@ -77,8 +77,8 @@ module IO::Evented
end

private def add_write_event(timeout = @write_timeout) : Nil
event = @write_event.get { Crystal::EventLoop.current.as(Crystal::LibEvent::EventLoop).create_fd_write_event(self) }
event.as(Crystal::LibEvent::Event).add timeout
event = @write_event.get { Crystal::EventLoop.current.create_fd_write_event(self) }
event.add timeout
end

def evented_close : Nil
Expand Down

0 comments on commit 3777d73

Please sign in to comment.