1
0
This repository has been archived on 2025-07-27. You can view files and clone it, but cannot push or open issues or pull requests.
Files
siadrive/SiaDrive.Api/AutoThread.h
Scott E. Graves 3949ba30e1 Refactoring
2017-02-18 10:15:01 -06:00

28 lines
452 B
C++

#pragma once
#include <SiaCurl.h>
#include <mutex>
NS_BEGIN(Sia)
NS_BEGIN(Api)
class AFX_EXT_CLASS CAutoThread
{
public:
CAutoThread(const CSiaCurl& siaCurl);
public:
virtual ~CAutoThread();
private:
CSiaCurl _siaCurl;
HANDLE _stopEvent;
std::unique_ptr<std::thread> _thread;
std::mutex _startStopMutex;
protected:
void StartAutoThread();
void StopAutoThread();
virtual void AutoThreadCallback(const CSiaCurl& siaCurl) = 0;
};
NS_END(2)