summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Williams <samuel.williams@oriontransfer.co.nz>2022-12-02 17:49:42 +1300
committerGitHub <noreply@github.com>2022-12-02 17:49:42 +1300
commit4fa47eabf21f3a13bb614cf8a63708f05decb710 (patch)
tree947eee5287099bb61de0c0113f78175888dc9627
parent7e3b42d008de3c69c9e6bc1d127f28d91c0e88a9 (diff)
downloadruby-4fa47eabf21f3a13bb614cf8a63708f05decb710.tar.gz
Clarify the storage argument. (#6849)
* Slightly more consistent indentation with other parts of the document.
-rw-r--r--NEWS.md10
-rw-r--r--include/ruby/internal/intern/cont.h9
2 files changed, 12 insertions, 7 deletions
diff --git a/NEWS.md b/NEWS.md
index a878cf30dd..1d3bb3ed77 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -104,11 +104,11 @@ Note: We're only listing outstanding class updates.
* Fiber
- * Introduce Fiber.[] and Fiber.[]= for inheritable fiber storage.
- Introduce Fiber#storage and Fiber#storage= (experimental) for
- getting and resetting the current storage. Introduce
- `Fiber.new(storage:)` for setting the storage when creating a
- fiber. [[Feature #19078]]
+ * Introduce Fiber.[] and Fiber.[]= for inheritable fiber storage.
+ Introduce Fiber#storage and Fiber#storage= (experimental) for
+ getting and resetting the current storage. Introduce
+ `Fiber.new(storage:)` for setting the storage when creating a
+ fiber. [[Feature #19078]]
Existing Thread and Fiber local variables can be tricky to use.
Thread local variables are shared between all fibers, making it
diff --git a/include/ruby/internal/intern/cont.h b/include/ruby/internal/intern/cont.h
index 3ee8b08dee..1ec78793b7 100644
--- a/include/ruby/internal/intern/cont.h
+++ b/include/ruby/internal/intern/cont.h
@@ -39,14 +39,18 @@ RBIMPL_SYMBOL_EXPORT_BEGIN()
VALUE rb_fiber_new(rb_block_call_func_t func, VALUE callback_obj);
/**
- * Creates a Fiber instance from a C-backended block with the specified storage.
+ * Creates a Fiber instance from a C-backended block with the specified
+ * storage.
*
- * If the given storage is Qundef, this function is equivalent to
+ * If the given storage is Qundef or Qtrue, this function is equivalent to
* rb_fiber_new() which inherits storage from the current fiber.
*
* If the given storage is Qfalse, this function uses the current fiber's
* storage by reference.
*
+ * Specifying either Qtrue or Qfalse is experimental and may be changed in the
+ * future.
+ *
* If the given storage is Qnil, this function will lazy initialize the
* internal storage which starts of empty (without any inheritance).
*
@@ -54,6 +58,7 @@ VALUE rb_fiber_new(rb_block_call_func_t func, VALUE callback_obj);
*
* @param[in] func A function, to become the fiber's body.
* @param[in] callback_obj Passed as-is to `func`.
+ * @param[in] storage The way to set up the storage for the fiber.
* @return An allocated new instance of rb_cFiber, which is ready to be
* "resume"d.
*/