downloader: use PBD::Thread instead of std::thread
This commit is contained in:
parent
aeccb137fd
commit
d087cd9465
|
@ -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
|
||||
|
|
|
@ -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<uint64_t> _download_size; /* read-only from requestor thread */
|
||||
std::atomic<uint64_t> _downloaded; /* read-only from requestor thread */
|
||||
std::atomic<int> _status;
|
||||
std::thread thr;
|
||||
PBD::Thread* thread;
|
||||
|
||||
void download ();
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue
Block a user