chenshuo / muduo

Event-driven network library for multi-threaded Linux server in C++11
https://github.com/chenshuo/muduo
Other
14.64k stars 5.14k forks source link

请问一下:exception caught in Thread reason: call to empty boost::function Aborted (core dumped) #654

Closed sychen12345 closed 1 year ago

sychen12345 commented 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 / } }

ggandycong commented 1 year ago

刘德聪,已经收到你的邮件,请你放心 祝你生活愉快,笑口常开

chenshuo commented 1 year ago

When filing an issue of muduo, please provide a SSCCE: Short, Self Contained, Correct (Compilable), Example.

特别是,你修改了 muduo,又不提供修改后的代码, 只是拿你改过的代码的故障现象来问我,我无从回答。