about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2017-03-22 07:17:12 +0000
committerEric Wong <e@80x24.org>2017-03-22 07:18:22 +0000
commit0a2e904c8fe06af5be3297d7096fe7ef97a1482a (patch)
treed79c42d7f8a5f35e5fc42e104b667b7d5a7ecd48
parent8b7e3ea07058c25e3870dad85f303a42fac146a8 (diff)
downloadsleepy_penguin-0a2e904c8fe06af5be3297d7096fe7ef97a1482a.tar.gz
Most of the time, we want the core "IO" class, but rdoc wants
to be clever...
-rw-r--r--ext/sleepy_penguin/epoll.c22
-rw-r--r--lib/sleepy_penguin/epoll.rb16
2 files changed, 19 insertions, 19 deletions
diff --git a/ext/sleepy_penguin/epoll.c b/ext/sleepy_penguin/epoll.c
index 09c4bf7..d692f18 100644
--- a/ext/sleepy_penguin/epoll.c
+++ b/ext/sleepy_penguin/epoll.c
@@ -102,7 +102,7 @@ static VALUE s_new(VALUE klass, VALUE _flags)
  * Register, modify, or register a watch for a given +io+ for events.
  *
  * +op+ may be one of +EPOLL_CTL_ADD+, +EPOLL_CTL_MOD+, or +EPOLL_CTL_DEL+
- * +io+ is an IO object or one which proxies via the +to_io+ method.
+ * +io+ is an +IO+ object or one which proxies via the +to_io+ method.
  * +events+ is an integer mask of events to watch for.
  *
  * Returns nil on success.
@@ -187,7 +187,7 @@ static VALUE real_epwait(struct ep_per_thread *ept)
  * call-seq:
  *        ep_io.epoll_wait([maxevents[, timeout]]) { |events, io| ... }
  *
- * Calls epoll_wait(2) and yields Integer +events+ and IO objects watched
+ * Calls epoll_wait(2) and yields Integer +events+ and +IO+ objects watched
  * for.  +maxevents+ is the maximum number of events to process at once,
  * lower numbers may prevent starvation when used by epoll_wait in multiple
  * threads.  Larger +maxevents+ reduces syscall overhead for
@@ -251,7 +251,7 @@ void sleepy_penguin_init_epoll(void)
          *
          * The Epoll class provides high-level access to epoll(7)
          * functionality in the Linux 2.6 and later kernels.  It provides
-         * fork and GC-safety for Ruby objects stored within the IO object
+         * fork and GC-safety for Ruby objects stored within the +IO+ object
          * and may be passed as an argument to IO.select.
          */
         cEpoll = rb_define_class_under(mSleepyPenguin, "Epoll", rb_cObject);
@@ -260,7 +260,7 @@ void sleepy_penguin_init_epoll(void)
          * Document-class: SleepyPenguin::Epoll::IO
          *
          * Epoll::IO is a low-level class.  It does not provide fork nor
-         * GC-safety, so Ruby IO objects added via epoll_ctl must be retained
+         * GC-safety, so Ruby +IO+ objects added via epoll_ctl must be retained
          * by the application until IO#close is called.
          */
         cEpoll_IO = rb_define_class_under(cEpoll, "IO", rb_cIO);
@@ -271,13 +271,13 @@ void sleepy_penguin_init_epoll(void)
 
         rb_define_method(cEpoll, "__event_flags", event_flags, 1);
 
-        /* registers an IO object via epoll_ctl */
+        /* registers a target +IO+ object via epoll_ctl */
         rb_define_const(cEpoll, "CTL_ADD", INT2NUM(EPOLL_CTL_ADD));
 
-        /* unregisters an IO object via epoll_ctl */
+        /* unregisters a target +IO+ object via epoll_ctl */
         rb_define_const(cEpoll, "CTL_DEL", INT2NUM(EPOLL_CTL_DEL));
 
-        /* modifies the registration of an IO object via epoll_ctl */
+        /* modifies the registration of a target +IO+ object via epoll_ctl */
         rb_define_const(cEpoll, "CTL_MOD", INT2NUM(EPOLL_CTL_MOD));
 
         /* specifies whether close-on-exec flag is set for Epoll.new */
@@ -309,9 +309,9 @@ void sleepy_penguin_init_epoll(void)
 #ifdef EPOLLEXCLUSIVE
         /*
          * Sets an exclusive wakeup mode for the epoll object
-         * that is being attached to the target IO.  This
+         * that is being attached to the target +IO+.  This
          * avoids thundering herd scenarios when the same
-         * target IO is shared among multiple epoll objects.
+         * target +IO+ is shared among multiple epoll objects.
          * Available since Linux 4.5
          */
         rb_define_const(cEpoll, "EXCLUSIVE", UINT2NUM(EPOLLEXCLUSIVE));
@@ -322,13 +322,13 @@ void sleepy_penguin_init_epoll(void)
 
         /*
          * watch for errors, there is no need to specify this,
-         * it is always monitored when an IO is watched
+         * it is always monitored when an +IO+ is watched
          */
         rb_define_const(cEpoll, "ERR", UINT2NUM(EPOLLERR));
 
         /*
          * watch for hangups, there is no need to specify this,
-         * it is always monitored when an IO is watched
+         * it is always monitored when an +IO+ is watched
          */
         rb_define_const(cEpoll, "HUP", UINT2NUM(EPOLLHUP));
 
diff --git a/lib/sleepy_penguin/epoll.rb b/lib/sleepy_penguin/epoll.rb
index da1502e..4d23968 100644
--- a/lib/sleepy_penguin/epoll.rb
+++ b/lib/sleepy_penguin/epoll.rb
@@ -45,7 +45,7 @@ class SleepyPenguin::Epoll
     end
   end
 
-  # Calls epoll_wait(2) and yields Integer +events+ and IO objects watched
+  # Calls epoll_wait(2) and yields Integer +events+ and +IO+ objects watched
   # for.  +maxevents+ is the maximum number of events to process at once,
   # lower numbers may prevent starvation when used by epoll_wait in multiple
   # threads.  Larger +maxevents+ reduces syscall overhead for
@@ -62,7 +62,7 @@ class SleepyPenguin::Epoll
     end
 
     # we keep a snapshot of @marks around in case another thread closes
-    # the IO while it is being transferred to userspace.  We release mtx
+    # the io while it is being transferred to userspace.  We release mtx
     # so another thread may add events to us while we're sleeping.
     @io.epoll_wait(maxevents, timeout) { |events, io| yield(events, io) }
   ensure
@@ -87,7 +87,7 @@ class SleepyPenguin::Epoll
   # call-seq:
   #     ep.del(io) -> 0
   #
-  # Disables an IO object from being watched.
+  # Disables an +IO+ object from being watched.
   def del(io)
     fd = io.to_io.fileno
     @mtx.synchronize do
@@ -125,7 +125,7 @@ class SleepyPenguin::Epoll
   # call-seq:
   #     epoll.mod(io, flags) -> 0
   #
-  # Changes the watch for an existing IO object based on +events+.
+  # Changes the watch for an existing +IO+ object based on +events+.
   # Returns zero on success, will raise SystemError on failure.
   def mod(io, events)
     events = __event_flags(events)
@@ -214,8 +214,8 @@ class SleepyPenguin::Epoll
   # call-seq:
   #     ep.io_for(io) -> object
   #
-  # Returns the given IO object currently being watched for.  Different
-  # IO objects may internally refer to the same process file descriptor.
+  # Returns the given +IO+ object currently being watched for.  Different
+  # +IO+ objects may internally refer to the same process file descriptor.
   # Mostly used for debugging.
   def io_for(io)
     fd = __fileno(io)
@@ -244,9 +244,9 @@ class SleepyPenguin::Epoll
   # call-seq:
   #     epoll.include?(io) -> true or false
   #
-  # Returns whether or not a given IO is watched and prevented from being
+  # Returns whether or not a given +IO+ is watched and prevented from being
   # garbage-collected by the current Epoll object.  This may include
-  # closed IO objects.
+  # closed +IO+ objects.
   def include?(io)
     fd = __fileno(io)
     @mtx.synchronize do