It seems that the blocking queue might be destroyed early than Run method complete. It might because the Run method throw some unhandled exception. However, it should be shared_ptr when multthread access an resource. So change BlockingQueue as a shared_ptr. test=develop