From d087cd9465547220e58ab74d2d653684fb3b58a3 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Tue, 13 Sep 2022 14:14:53 -0600 Subject: [PATCH] downloader: use PBD::Thread instead of std::thread --- libs/pbd/downloader.cc | 5 ++--- libs/pbd/pbd/downloader.h | 4 +++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/libs/pbd/downloader.cc b/libs/pbd/downloader.cc index 4ed2bf0a6e..1d561acaf4 100644 --- a/libs/pbd/downloader.cc +++ b/libs/pbd/downloader.cc @@ -82,14 +82,13 @@ Downloader::start () _cancel = false; _status = 0; /* unknown at this point */ - thr = std::thread (&Downloader::download, this); - return 0; + return 0 != (thread = PBD::Thread::create (boost::bind (&Downloader::download, this))); } void Downloader::cleanup () { - thr.join (); + thread->join (); } void diff --git a/libs/pbd/pbd/downloader.h b/libs/pbd/pbd/downloader.h index 19f8f46042..191bb95ab6 100644 --- a/libs/pbd/pbd/downloader.h +++ b/libs/pbd/pbd/downloader.h @@ -29,6 +29,8 @@ namespace PBD { +class Thread; + class LIBPBD_API Downloader { public: Downloader (std::string const & url, std::string const & destdir); @@ -58,7 +60,7 @@ class LIBPBD_API Downloader { std::atomic _download_size; /* read-only from requestor thread */ std::atomic _downloaded; /* read-only from requestor thread */ std::atomic _status; - std::thread thr; + PBD::Thread* thread; void download (); };