Skip to content

Commit 85c0725

Browse files
committed
remove TSContSchedule, then rename TSContScheduleOnPool to TSContSchedule
1 parent b5ab430 commit 85c0725

File tree

20 files changed

+85
-313
lines changed

20 files changed

+85
-313
lines changed

doc/.tx/config

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -698,8 +698,8 @@ source_file = _build/locale/pot/developer-guide/api/functions/TSContMutexGet.en.
698698
source_lang = en
699699

700700
[apache-traffic-server-6x.developer-guide--api--functions--TSContSchedule_en]
701-
file_filter = locale/<lang>/LC_MESSAGES/developer-guide/api/functions/TSContSchedule.en.po
702-
source_file = _build/locale/pot/developer-guide/api/functions/TSContSchedule.en.pot
701+
file_filter = locale/<lang>/LC_MESSAGES/developer-guide/api/functions/TSContScheduleOnPool.en.po
702+
source_file = _build/locale/pot/developer-guide/api/functions/TSContScheduleOnPool.en.pot
703703
source_lang = en
704704

705705
[apache-traffic-server-6x.developer-guide--api--functions--TSDebug_en]

doc/developer-guide/api/functions/TSContScheduleEvery.en.rst

Lines changed: 0 additions & 58 deletions
This file was deleted.

doc/developer-guide/api/functions/TSContSchedule.en.rst renamed to doc/developer-guide/api/functions/TSContScheduleEveryOnPool.en.rst

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818

1919
.. default-domain:: c
2020

21-
TSContSchedule
22-
**************
21+
TSContScheduleEveryOnPool
22+
*************************
2323

2424
Synopsis
2525
========
@@ -28,31 +28,31 @@ Synopsis
2828
2929
#include <ts/ts.h>
3030
31-
.. function:: TSAction TSContSchedule(TSCont contp, TSHRTime timeout)
31+
.. function:: TSAction TSContScheduleEveryOnPool(TSCont contp, TSHRTime every)
3232

3333
Description
3434
===========
3535

36-
Schedules :arg:`contp` to run :arg:`delay` milliseconds in the future. This is approximate. The delay
37-
will be at least :arg:`delay` but possibly more. Resolutions finer than roughly 5 milliseconds will
38-
not be effective. :arg:`contp` is required to have a mutex, which is provided to
36+
Schedules :arg:`contp` to run :arg:`every` milliseconds, on a random thread that belongs to
37+
:arg:`tp`. The :arg:`every` is an approximation, meaning it will be at least :arg:`every`
38+
milliseconds but possibly more. Resolutions finer than roughly 5 milliseconds will not be
39+
effective. Note that :arg:`contp` is required to have a mutex, which is provided to
3940
:func:`TSContCreate`.
4041

41-
The return value can be used to cancel the scheduled event via :func:`TSActionCancel`. This is
42-
effective until the continuation :arg:`contp` is being dispatched. However, if it is scheduled on
43-
another thread this can be problematic to be correctly timed. The return value can be checked with
44-
:func:`TSActionDone` to see if the continuation ran before the return, which is possible if
45-
:arg:`timeout` is `0`. Returns ``nullptr`` if thread affinity was cleared.
42+
The return value can be used to cancel the scheduled event via :func:`TSActionCancel`. This
43+
is effective until the continuation :arg:`contp` is being dispatched. However, if it is
44+
scheduled on another thread this can be problematic to be correctly timed. The return value
45+
can be checked with :func:`TSActionDone` to see if the continuation ran before the return,
46+
which is possible if :arg:`timeout` is `0`.
4647

47-
TSContSchedule() or TSContScheduleEvery() will default to set the thread affinity to the calling thread
48-
when no affinity is already set for example, using :func:`TSContThreadAffinitySet`
48+
If :arg:`contp` has no thread affinity set, the thread it is now scheduled on will be set
49+
as its thread affinity thread.
4950

5051
Note that the TSContSchedule() family of API shall only be called from an ATS EThread.
5152
Calling it from raw non-EThreads can result in unpredictable behavior.
5253

5354
See Also
5455
========
5556

56-
:doc:`TSContScheduleEvery.en`
5757
:doc:`TSContScheduleOnPool.en`
5858
:doc:`TSContScheduleOnThread.en`

doc/developer-guide/api/functions/TSContScheduleOnPool.en.rst

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,16 @@ Synopsis
3333
Description
3434
===========
3535

36-
Mostly the same as :func:`TSContSchedule`. Schedules :arg:`contp` on a random thread that belongs to :arg:`tp`.
37-
If thread type of the thread specified by thread affinity is the same as :arg:`tp`, the :arg:`contp` will
38-
be scheduled on the thread specified by thread affinity.
36+
Schedules :arg:`contp` to run :arg:`timeout` milliseconds in the future, on a random thread that
37+
belongs to :arg:`tp`. The :arg:`timeout` is an approximation, meaning it will be at least
38+
:arg:`timeout` milliseconds but possibly more. Resolutions finer than roughly 5 milliseconds will
39+
not be effective. Note that :arg:`contp` is required to have a mutex, which is provided to
40+
:func:`TSContCreate`.
3941

40-
The continuation is scheduled for a particular thread selected from a group of similar threads, as indicated by :arg:`tp`.
42+
The continuation is scheduled for a particular thread selected from a group of similar threads,
43+
as indicated by :arg:`tp`. If :arg:`contp` already has an thread affinity set, and the thread
44+
type of thread affinity is the same as :arg:`tp`, then :arg:`contp` will be scheduled on the
45+
thread specified by thread affinity.
4146

4247
=========================== =======================================================================================
4348
Pool Properties
@@ -54,6 +59,15 @@ called and continuations that use them have the same restrictions. ``TS_THREAD_P
5459
are threads that exist to perform long or blocking actions, although sufficiently long operation can
5560
impact system performance by blocking other continuations on the threads.
5661

62+
The return value can be used to cancel the scheduled event via :func:`TSActionCancel`. This is
63+
effective until the continuation :arg:`contp` is being dispatched. However, if it is scheduled on
64+
another thread this can be problematic to be correctly timed. The return value can be checked with
65+
:func:`TSActionDone` to see if the continuation ran before the return, which is possible if
66+
:arg:`timeout` is `0`.
67+
68+
If :arg:`contp` has no thread affinity set, the thread it is now scheduled on will be set
69+
as its thread affinity thread.
70+
5771
Note that the TSContSchedule() family of API shall only be called from an ATS EThread.
5872
Calling it from raw non-EThreads can result in unpredictable behavior.
5973

@@ -124,6 +138,5 @@ the same continuation on two different threads of the same type.
124138
See Also
125139
========
126140

127-
:doc:`TSContSchedule.en`
128-
:doc:`TSContScheduleEvery.en`
141+
:doc:`TSContScheduleEveryOnPool.en`
129142
:doc:`TSContScheduleOnThread.en`

doc/developer-guide/api/functions/TSContScheduleOnThread.en.rst

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,25 @@ Synopsis
3333
Description
3434
===========
3535

36-
Mostly the same as :func:`TSContSchedule`. Schedules :arg:`contp` on :arg:`ethread`.
36+
Schedules :arg:`contp` to run :arg:`timeout` milliseconds in the future, on the thread specified by
37+
:arg:`ethread`. The :arg:`timeout` is an approximation, meaning it will be at least :arg:`timeout`
38+
milliseconds but possibly more. Resolutions finer than roughly 5 milliseconds will not be effective.
39+
Note that :arg:`contp` is required to have a mutex, which is provided to :func:`TSContCreate`.
40+
41+
The return value can be used to cancel the scheduled event via :func:`TSActionCancel`. This is
42+
effective until the continuation :arg:`contp` is being dispatched. However, if it is scheduled on
43+
another thread this can be problematic to be correctly timed. The return value can be checked with
44+
:func:`TSActionDone` to see if the continuation ran before the return, which is possible if
45+
:arg:`timeout` is `0`.
46+
47+
If :arg:`contp` has no thread affinity set, the thread it is now scheduled on will be set
48+
as its thread affinity thread.
3749

3850
Note that the TSContSchedule() family of API shall only be called from an ATS EThread.
3951
Calling it from raw non-EThreads can result in unpredictable behavior.
4052

4153
See Also
4254
========
4355

44-
:doc:`TSContSchedule.en`
45-
:doc:`TSContScheduleEvery.en`
4656
:doc:`TSContScheduleOnPool.en`
57+
:doc:`TSContScheduleEveryOnPool.en`

doc/developer-guide/api/functions/TSContThreadAffinitySet.en.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ Description
3434
===========
3535

3636
Set the thread affinity of continuation :arg:`contp` to :arg:`ethread`. Future calls to
37-
:func:`TSContSchedule`, and :func:`TSContScheduleOnPool` that has the same type as :arg:`ethread`
37+
:func:`TSContScheduleOnPool`, and :func:`TSContScheduleOnPool` that has the same type as :arg:`ethread`
3838
will schedule the continuation on :arg:`ethread`, rather than an arbitrary thread of that type.
3939

40-
:func:`TSContSchedule` and :func:``TSContScheduleEvery` will default the affinity to calling thread
40+
:func:`TSContScheduleOnPool` and :func:`TSContScheduleEveryOnPool` will default the affinity to calling thread
4141
when invoked without explicitly setting the thread affinity.
4242

4343
Return Values

doc/developer-guide/plugins/continuations/activating-continuations.en.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Activating Continuations
2323
************************
2424

2525
Continuations are activated when they receive an event or by
26-
``TSContSchedule`` (which schedules a continuation to receive an event).
26+
``TSContScheduleOnPool`` (which schedules a continuation to receive an event).
2727
Continuations might receive an event because:
2828

2929
- Your plugin calls ``TSContCall``

doc/developer-guide/plugins/continuations/index.en.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ one of the following:
5454
transactions uses ``TSContDataSet/Get``
5555

5656
- uses ``TSCacheXXX``, ``TSNetXXX``, ``TSHostLookup``, or
57-
``TSContSchedule`` APIs
57+
``TSContScheduleOnPool`` APIs
5858

5959
Before being activated, a caller must grab the continuation's mutex.
6060
This requirement makes it possible for a continuation's handler function

doc/developer-guide/plugins/continuations/writing-handler-functions.en.rst

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ Event Event Sender
9595
:data:`TS_EVENT_CACHE_LOOKUP_COMPLETE` :data:`TS_HTTP_CACHE_LOOKUP_COMPLETE_HOOK` :type:`TSHttpTxn`
9696
:data:`TS_EVENT_IMMEDIATE` :func:`TSVConnClose`
9797
:func:`TSVIOReenable`
98-
:func:`TSContSchedule`
9998
:func:`TSContScheduleOnPool`
10099
:func:`TSContScheduleOnThread`
101100
:data:`TS_EVENT_IMMEDIATE` :data:`TS_HTTP_REQUEST_TRANSFORM_HOOK`
@@ -113,8 +112,7 @@ Event Event Sender
113112
:func:`TSHttpTxnServerIntercept`
114113
:func:`TSHttpTxnIntercept`
115114
:data:`TS_EVENT_HOST_LOOKUP` :func:`TSHostLookup` :type:`TSHostLookupResult`
116-
:data:`TS_EVENT_TIMEOUT` :func:`TSContSchedule`
117-
:func:`TSContScheduleOnPool`
115+
:data:`TS_EVENT_TIMEOUT` :func:`TSContScheduleOnPool`
118116
:func:`TSContScheduleOnThread`
119117
:data:`TS_EVENT_ERROR`
120118
:data:`TS_EVENT_VCONN_READ_READY` :func:`TSVConnRead` :type:`TSVIO`
@@ -137,6 +135,5 @@ The continuation functions are listed below:
137135
- :func:`TSContDataSet`
138136
- :func:`TSContDestroy`
139137
- :func:`TSContMutexGet`
140-
- :func:`TSContSchedule`
141138
- :func:`TSContScheduleOnPool`
142139
- :func:`TSContScheduleOnThread`

doc/locale/ja/LC_MESSAGES/developer-guide/api/functions/TSContSchedule.en.po renamed to doc/locale/ja/LC_MESSAGES/developer-guide/api/functions/TSContScheduleOnPool.en.po

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,18 @@ msgstr ""
2929
"Content-Transfer-Encoding: 8bit\n"
3030
"Generated-By: Babel 2.1.1\n"
3131

32-
#: ../../developer-guide/api/functions/TSContSchedule.en.rst:32
32+
#: ../../developer-guide/api/functions/TSContScheduleOnPool.en.rst:32
3333
msgid "Description"
3434
msgstr "解説"
3535

36-
#: ../../developer-guide/api/functions/TSContSchedule.en.rst:25
36+
#: ../../developer-guide/api/functions/TSContScheduleOnPool.en.rst:25
3737
msgid "Synopsis"
3838
msgstr "概要"
3939

40-
#: ../../developer-guide/api/functions/TSContSchedule.en.rst:22
41-
msgid "TSContSchedule"
40+
#: ../../developer-guide/api/functions/TSContScheduleOnPool.en.rst:22
41+
msgid "TSContScheduleOnPool"
4242
msgstr ""
4343

44-
#: ../../developer-guide/api/functions/TSContSchedule.en.rst:27
44+
#: ../../developer-guide/api/functions/TSContScheduleOnPool.en.rst:27
4545
msgid "`#include <ts/ts.h>`"
4646
msgstr "`#include <ts/ts.h>`"

0 commit comments

Comments
 (0)