Skip to content

Commit 774d687

Browse files
authored
Update about-counter.md
1 parent 4bc8e56 commit 774d687

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

docs/en/about-counter.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,16 +170,17 @@ In the example, a counter named "c1" is created, and in the HTTP callback, call
170170
class WFTaskFactory
171171
{
172172
...
173-
static void count_by_name(const std::string& counter_name);
173+
static int count_by_name(const std::string& counter_name);
174174

175-
static void count_by_name(const std::string& counter_name, unsigned int n);
175+
static int count_by_name(const std::string& counter_name, unsigned int n);
176176
...
177177
};
178178
~~~
179179

180180
You can pass an integer n to **WFTaskFactory::count\_by\_name**, indicating the count value to be increased in this operation. Obviously:
181181
**count\_by\_name("c1")** is equivalent to **count\_by\_name("c1", 1)**.
182-
If the "c1" counter does not exist (not created or already completed), the operation on "c1" will have no effect, so the wild pointer problem in an anonymous counter will not happen here.
182+
If the "c1" counter does not exist (not created or already completed), the operation on "c1" will have no effect, so the wild pointer problem in an anonymous counter will not happen here.
183+
The **count\_by\_name()** function returns the number of counters that was waked up by the operation. When **n** is greater that 1, more than one counter may reach target value.
183184

184185
# Definition of the detailed behaviors of named counters
185186

0 commit comments

Comments
 (0)