download: give download threads distinct names
This commit is contained in:
parent
f6211322e5
commit
f36c5f1e08
1 changed files with 5 additions and 0 deletions
|
@ -27,6 +27,7 @@
|
||||||
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <atomic>
|
||||||
#include <boost/filesystem.hpp>
|
#include <boost/filesystem.hpp>
|
||||||
#include <boost/asio.hpp>
|
#include <boost/asio.hpp>
|
||||||
#include <boost/thread/thread.hpp>
|
#include <boost/thread/thread.hpp>
|
||||||
|
@ -59,6 +60,10 @@ namespace tools
|
||||||
|
|
||||||
static void download_thread(download_async_handle control)
|
static void download_thread(download_async_handle control)
|
||||||
{
|
{
|
||||||
|
static std::atomic<unsigned int> thread_id(0);
|
||||||
|
|
||||||
|
MLOG_SET_THREAD_NAME("DL" + std::to_string(thread_id++));
|
||||||
|
|
||||||
struct stopped_setter
|
struct stopped_setter
|
||||||
{
|
{
|
||||||
stopped_setter(const download_async_handle &control): control(control) {}
|
stopped_setter(const download_async_handle &control): control(control) {}
|
||||||
|
|
Loading…
Reference in a new issue