summaryrefslogtreecommitdiff
path: root/thread.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-02-23 02:18:52 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-02-23 02:18:52 +0000
commit96db72ce38b27799dd8e80ca00696e41234db6ba (patch)
tree4c210692772faf26ed8ddac746dc79aec0240e2d /thread.c
parentb9d01e225723b3dfb6e18d0dcb790c20fef78d63 (diff)
[DOC] missing docs at toplevel
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62544 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread.c')
-rw-r--r--thread.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/thread.c b/thread.c
index 56fd7f9926..27f5e5dabf 100644
--- a/thread.c
+++ b/thread.c
@@ -3182,6 +3182,19 @@ rb_thread_aref(VALUE thread, VALUE key)
return rb_thread_local_aref(thread, id);
}
+/*
+ * call-seq:
+ * thr.fetch(sym) -> obj
+ * thr.fetch(sym) { } -> obj
+ * thr.fetch(sym, default) -> obj
+ *
+ * Returns a fiber-local for the given key. If the key can't be
+ * found, there are several options: With no other arguments, it will
+ * raise a <code>KeyError</code> exception; if <i>default</i> is
+ * given, then that will be returned; if the optional code block is
+ * specified, then that will be run and its result returned.
+ * See Thread#[] and Hash#fetch.
+ */
static VALUE
rb_thread_fetch(int argc, VALUE *argv, VALUE self)
{