MJY-HUST commented on code in PR #2645: URL: https://github.com/apache/brpc/pull/2645#discussion_r1635199601
########## src/bthread/key.cpp: ########## @@ -204,14 +205,57 @@ class BAIDU_CACHELINE_ALIGNMENT KeyTable { SubKeyTable* _subs[KEY_1STLEVEL_SIZE]; }; +class KeyTableList { +public: + KeyTableList() { + keytable = NULL; + } + ~KeyTableList() { + bthread::TaskGroup* g = bthread::tls_task_group; + bthread::KeyTable* old_kt = bthread::tls_bls.keytable; + while (keytable) { + bthread::KeyTable* kt = keytable; + keytable = kt->next; + bthread::tls_bls.keytable = kt; + if (g) { + g->current_task()->local_storage.keytable = kt; + } + delete kt; + if (old_kt == kt) { + old_kt = NULL; + } + g = bthread::tls_task_group; + } + bthread::tls_bls.keytable = old_kt; + if(g) { + g->current_task()->local_storage.keytable = old_kt; + } + } + KeyTable* keytable; Review Comment: 改成了struct -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org For additional commands, e-mail: dev-h...@brpc.apache.org