Skip to content

Commit 9d61e9b

Browse files
committed
Optimize naming
1 parent 71ba6c0 commit 9d61e9b

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

gdbinit

+5-5
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,10 @@ define sw_hash_map_list
5858
end
5959

6060
define co_list
61-
call swoole_coro_iterator_reset()
61+
call swoole_coroutine_iterator_reset()
6262
set $running = 1
6363
while $running
64-
set $co = swoole_coro_iterator_each()
64+
set $co = swoole_coroutine_iterator_each()
6565
if $co
6666
printf "coroutine %ld ", $co->cid
6767
if $co->state == 0
@@ -83,7 +83,7 @@ define co_list
8383
end
8484

8585
define co_bt
86-
if swoole_coro_count() == 0
86+
if swoole_coroutine_count() == 0
8787
printf "no coroutine is running\n"
8888
end
8989
____sw_executor_globals
@@ -111,7 +111,7 @@ end
111111

112112
define __co_bt
113113
set $cid = (int)$arg0
114-
set $co = swoole_coro_get($cid)
114+
set $co = swoole_coroutine_get($cid)
115115
if $co
116116
set $task = ('swoole::PHPContext' *) $co->get_task()
117117
if $task
@@ -125,7 +125,7 @@ end
125125
define co_status
126126
printf "\t c_stack_size: %d\n", 'swoole::Coroutine::stack_size'
127127
printf "\t active: %d\n", 'swoole::PHPCoroutine::active'
128-
printf "\t coro_num: %d\n", swoole_coro_count()
128+
printf "\t coro_num: %d\n", swoole_coroutine_count()
129129
printf "\t peak_coro_num: %d\n", 'swoole::Coroutine::peak_num'
130130
printf "\t config: "
131131
print 'swoole::PHPCoroutine::config'

include/swoole_coroutine.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ bool run(const CoroutineFunc &fn, void *arg = nullptr);
262262
/**
263263
* for gdb
264264
*/
265-
swoole::Coroutine *swoole_coro_iterator_each();
266-
void swoole_coro_iterator_reset();
265+
swoole::Coroutine *swoole_coroutine_iterator_each();
266+
void swoole_coroutine_iterator_reset();
267267
swoole::Coroutine *swoole_coroutine_get(long cid);
268268
size_t swoole_coroutine_count();

src/coroutine/base.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -262,11 +262,11 @@ size_t swoole_coroutine_count() {
262262
*/
263263
static std::unordered_map<long, swoole::Coroutine *>::iterator _gdb_iterator;
264264

265-
void swoole_coro_iterator_reset() {
265+
void swoole_coroutine_iterator_reset() {
266266
_gdb_iterator = swoole::Coroutine::coroutines.begin();
267267
}
268268

269-
swoole::Coroutine *swoole_coro_iterator_each() {
269+
swoole::Coroutine *swoole_coroutine_iterator_each() {
270270
if (_gdb_iterator == swoole::Coroutine::coroutines.end()) {
271271
return nullptr;
272272
} else {

0 commit comments

Comments
 (0)