Skip to content

Commit

Permalink
Optimize naming
Browse files Browse the repository at this point in the history
  • Loading branch information
matyhtf committed Jul 9, 2021
1 parent 71ba6c0 commit 9d61e9b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions gdbinit
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ define sw_hash_map_list
end

define co_list
call swoole_coro_iterator_reset()
call swoole_coroutine_iterator_reset()
set $running = 1
while $running
set $co = swoole_coro_iterator_each()
set $co = swoole_coroutine_iterator_each()
if $co
printf "coroutine %ld ", $co->cid
if $co->state == 0
Expand All @@ -83,7 +83,7 @@ define co_list
end

define co_bt
if swoole_coro_count() == 0
if swoole_coroutine_count() == 0
printf "no coroutine is running\n"
end
____sw_executor_globals
Expand Down Expand Up @@ -111,7 +111,7 @@ end

define __co_bt
set $cid = (int)$arg0
set $co = swoole_coro_get($cid)
set $co = swoole_coroutine_get($cid)
if $co
set $task = ('swoole::PHPContext' *) $co->get_task()
if $task
Expand All @@ -125,7 +125,7 @@ end
define co_status
printf "\t c_stack_size: %d\n", 'swoole::Coroutine::stack_size'
printf "\t active: %d\n", 'swoole::PHPCoroutine::active'
printf "\t coro_num: %d\n", swoole_coro_count()
printf "\t coro_num: %d\n", swoole_coroutine_count()
printf "\t peak_coro_num: %d\n", 'swoole::Coroutine::peak_num'
printf "\t config: "
print 'swoole::PHPCoroutine::config'
Expand Down
4 changes: 2 additions & 2 deletions include/swoole_coroutine.h
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ bool run(const CoroutineFunc &fn, void *arg = nullptr);
/**
* for gdb
*/
swoole::Coroutine *swoole_coro_iterator_each();
void swoole_coro_iterator_reset();
swoole::Coroutine *swoole_coroutine_iterator_each();
void swoole_coroutine_iterator_reset();
swoole::Coroutine *swoole_coroutine_get(long cid);
size_t swoole_coroutine_count();
4 changes: 2 additions & 2 deletions src/coroutine/base.cc
Original file line number Diff line number Diff line change
Expand Up @@ -262,11 +262,11 @@ size_t swoole_coroutine_count() {
*/
static std::unordered_map<long, swoole::Coroutine *>::iterator _gdb_iterator;

void swoole_coro_iterator_reset() {
void swoole_coroutine_iterator_reset() {
_gdb_iterator = swoole::Coroutine::coroutines.begin();
}

swoole::Coroutine *swoole_coro_iterator_each() {
swoole::Coroutine *swoole_coroutine_iterator_each() {
if (_gdb_iterator == swoole::Coroutine::coroutines.end()) {
return nullptr;
} else {
Expand Down

0 comments on commit 9d61e9b

Please sign in to comment.