fork(9) download
  1. #include <string>
  2. #include <thread>
  3.  
  4. class MyClass
  5. {
  6. public:
  7. MyClass():DiskJobThread(){};
  8. ~MyClass();
  9.  
  10. void DoDiskJobThread();
  11.  
  12. private:
  13. int CopyThread(const std::wstring & Source, const std::wstring & Target) { return 0; }
  14. int MoveThread(const std::wstring & Source, const std::wstring & Target) { return 0; }
  15. std::thread DiskJobThread;
  16. };
  17.  
  18. MyClass::~MyClass()
  19. {
  20. DiskJobThread.join();
  21. }
  22.  
  23. void MyClass::DoDiskJobThread()
  24. {
  25. std::wstring Source/* = GetSource()*/;
  26. std::wstring Target/* = GetTarget()*/;
  27. int m_OperationType/* = GetOperationType()*/;
  28. DiskJobThread = std::thread(&MyClass::CopyThread, this, Source, Target);
  29. DiskJobThread = std::thread(&MyClass::MoveThread, this, Source, Target);
  30. }
  31.  
  32. int main()
  33. {}
Success #stdin #stdout 0s 3340KB
stdin
Standard input is empty
stdout
Standard output is empty