Skip to content

Commit c78d2df

Browse files
authored
Correct fiber_cancel() documentation
Resolves #3088
1 parent 1167609 commit c78d2df

File tree

2 files changed

+21
-13
lines changed
  • doc/dev_guide/reference_capi
  • locale/ru/LC_MESSAGES/dev_guide/reference_capi

2 files changed

+21
-13
lines changed

doc/dev_guide/reference_capi/fiber.rst

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,13 @@
6969
7070
.. c:function:: void fiber_cancel(struct fiber *f)
7171
72-
Cancel the subject fiber (set ``FIBER_IS_CANCELLED`` flag)
72+
Cancel the subject fiber.
7373
74-
If target fiber's flag ``FIBER_IS_CANCELLABLE`` set, then it would be woken
75-
up (maybe prematurely). Then current fiber yields until the target fiber is
76-
dead (or is woken up by :ref:`fiber_wakeup()<c_api-fiber-fiber_wakeup>`).
74+
Cancellation is asynchronous. Use :ref:`fiber_join()<c_api-fiber-fiber_join>`
75+
to wait for the cancellation to complete.
76+
77+
After ``fiber_cancel()`` is called, the fiber may or may not check whether it
78+
was cancelled. If the fiber does not check it, it cannot ever be cancelled.
7779
7880
:param struct fiber* f: fiber to be cancelled
7981
@@ -96,6 +98,8 @@
9698
:param struct fiber* f: fiber
9799
:param bool yesno: status to set
98100
101+
.. _c_api-fiber-fiber_join:
102+
99103
.. c:function:: void fiber_join(struct fiber *f)
100104
101105
Wait until the fiber is dead and then move its execution status to the

locale/ru/LC_MESSAGES/dev_guide/reference_capi/fiber.po

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -85,18 +85,22 @@ msgstr "Прерывание синхронного ожидания файбе
8585
msgid "fiber to be woken up"
8686
msgstr "пробуждаемый файбер"
8787

88-
msgid "Cancel the subject fiber (set ``FIBER_IS_CANCELLED`` flag)"
89-
msgstr "Отмена файбера (установка флага ``FIBER_IS_CANCELLED``)"
88+
msgid "Cancel the subject fiber."
89+
msgstr "Отмена файбера."
9090

9191
msgid ""
92-
"If target fiber's flag ``FIBER_IS_CANCELLABLE`` set, then it would be woken "
93-
"up (maybe prematurely). Then current fiber yields until the target fiber is "
94-
"dead (or is woken up by :ref:`fiber_wakeup()<c_api-fiber-fiber_wakeup>`)."
92+
"Cancellation is asynchronous. Use :ref:`fiber_join()<c_api-fiber-fiber_join>` "
93+
"to wait for the cancellation to complete."
9594
msgstr ""
96-
"Если на нужном файбере установлен флаг ``FIBER_IS_CANCELLABLE``, он "
97-
"возобновит работу (возможно досрочно). Тогда текущий файбер передает "
98-
"управление до тех пор, пока нужный файбер не будет удален (или не возобновит"
99-
" работу с помощью :ref:`fiber_wakeup()<c_api-fiber-fiber_wakeup>`)."
95+
"Отмена файбера происходит асинхронно. Чтобы дождаться окончания отмены, "
96+
"используйте :ref:`fiber_join()<c_api-fiber-fiber_join>`."
97+
98+
msgid ""
99+
"After ``fiber_cancel()`` is called, the fiber may or may not check whether it "
100+
"was cancelled. If the fiber does not check it, it cannot ever be cancelled."
101+
msgstr ""
102+
"После вызова ``fiber_cancel()`` файбер может проверить, был ли он отменен. "
103+
"Если он этого не сделает, его отменить невозможно. "
100104

101105
msgid "fiber to be cancelled"
102106
msgstr "отменяемый файбер"

0 commit comments

Comments
 (0)