ext/rev/rev_loop.c in rev-0.2.2 vs ext/rev/rev_loop.c in rev-0.2.3
- old
+ new
@@ -6,12 +6,11 @@
#include <assert.h>
#include "ruby.h"
#include "rubysig.h"
-#define EV_STANDALONE 1
-#include "../libev/ev.h"
+#include "ev_wrap.h"
#include "rev.h"
static VALUE mRev = Qnil;
static VALUE cRev_Loop = Qnil;
@@ -206,11 +205,11 @@
}
static void Rev_Loop_ev_loop_oneshot(struct Rev_Loop *loop_data)
{
/* Use Ruby 1.9's rb_thread_blocking_region call to make a blocking system call */
- rb_thread_blocking_region(Rev_Loop_ev_loop_oneshot_blocking, loop_data, RB_UBF_DFL, 0);
+ rb_thread_blocking_region(Rev_Loop_ev_loop_oneshot_blocking, loop_data, RUBY_UBF_IO, 0);
}
#endif
/* Ruby 1.8 requires us to periodically run the event loop then defer back to
* the green threads scheduler */
@@ -218,10 +217,11 @@
#define BLOCKING_INTERVAL 0.01 /* Block for 10ms at a time */
/* Stub for scheduler's ev_timer callback */
static void timer_callback(struct ev_loop *ev_loop, struct ev_timer *timer, int revents)
{
+ ev_timer_again (ev_loop, timer);
}
/* Run the event loop, calling rb_thread_schedule every 10ms */
static void Rev_Loop_ev_loop_oneshot(struct Rev_Loop *loop_data)
{
@@ -282,6 +282,6 @@
continue;
Data_Get_Struct(loop_data->eventbuf[i].watcher, struct Rev_Watcher, watcher_data);
watcher_data->dispatch_callback(loop_data->eventbuf[i].watcher, loop_data->eventbuf[i].revents);
}
-}
\ No newline at end of file
+}