Closed sychen12345 closed 1 year ago
Thread_test.cc 我因为一些业务原因,需要在Thread.cc里面新增pthread_detach()函数,用于取代join(),但是他直接提示我为空,请问陈硕大佬,这是为什么呀 class test { private: public: void foo() { while (1) { } } void start() { muduo::Thread t1(std::bind(&test::foo, this)); t1.start(); t1.deteach(); } test() {} ~test() {} };
int main() { test t; t.start(); while (1) { / code / } }
刘德聪,已经收到你的邮件,请你放心 祝你生活愉快,笑口常开
When filing an issue of muduo, please provide a SSCCE: Short, Self Contained, Correct (Compilable), Example.
特别是,你修改了 muduo,又不提供修改后的代码, 只是拿你改过的代码的故障现象来问我,我无从回答。
Thread_test.cc 我因为一些业务原因,需要在Thread.cc里面新增pthread_detach()函数,用于取代join(),但是他直接提示我为空,请问陈硕大佬,这是为什么呀 class test { private: public: void foo() { while (1) { } } void start() { muduo::Thread t1(std::bind(&test::foo, this)); t1.start(); t1.deteach(); } test() {} ~test() {} };
int main() { test t; t.start(); while (1) { / code / } }