mirror of
https://github.com/etlegacy/Update-Installer.git
synced 2024-11-23 12:22:23 +00:00
Use boost threads to run the update installation on a background thread.
This commit is contained in:
parent
8e47110231
commit
2efb4fcaf3
2 changed files with 8 additions and 0 deletions
|
@ -1,5 +1,6 @@
|
|||
|
||||
find_package(Boost REQUIRED)
|
||||
find_package(Threads REQUIRED)
|
||||
|
||||
add_definitions(-DTIXML_USE_STL)
|
||||
|
||||
|
@ -34,6 +35,7 @@ target_link_libraries(updater
|
|||
tinyxml
|
||||
minizip
|
||||
# TODO - Mac and Windows version
|
||||
pthread
|
||||
/usr/lib/libboost_thread.a
|
||||
)
|
||||
|
||||
|
|
|
@ -12,6 +12,9 @@
|
|||
|
||||
#include <iostream>
|
||||
|
||||
#include <boost/bind.hpp>
|
||||
#include <boost/thread.hpp>
|
||||
|
||||
void setupUi(UpdateInstaller* installer);
|
||||
|
||||
int main(int argc, char** argv)
|
||||
|
@ -43,7 +46,10 @@ int main(int argc, char** argv)
|
|||
installer.setPackageDir(options.packageDir);
|
||||
installer.setScript(&script);
|
||||
installer.setWaitPid(options.waitPid);
|
||||
|
||||
installer.run();
|
||||
boost::thread updaterThread(boost::bind(&UpdateInstaller::run,&installer));
|
||||
updaterThread.join();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue