[FS9] Stop using Fs9Host and Fs9Client as CContinuousWorkers

Both were continuous workers since a blocking IDirectPlay8Peer::SendTo()
method was used. Since we use the default async method now, we don't need
the threaded implementation any longer. It still could happen that GUI
blocks for too long, but that would happen also for other simulator drivers.

ref T433
This commit is contained in:
Roland Rossgotterer
2019-02-13 14:55:56 +01:00
committed by Mat Sutcliffe
parent 949e013f0b
commit d6d2c0cc80
7 changed files with 29 additions and 58 deletions

View File

@@ -18,7 +18,6 @@
#include "blackmisc/logcategorylist.h"
#include <QObject>
#include <QList>
#include <QMutex>
#include <QScopedPointer>
#include <dplay8.h>
#include <functional>
@@ -31,13 +30,13 @@ namespace BlackSimPlugin
//! DirectPlay peer implementation
//! More information can be found in the DirectX9 SDK documentation
//! http://doc.51windows.net/Directx9_SDK/?url=/Directx9_SDK/play/dplay.htm
class CDirectPlayPeer : public BlackMisc::CContinuousWorker
class CDirectPlayPeer : public QObject
{
Q_OBJECT
public:
//! Constructor
CDirectPlayPeer(QObject *owner, const BlackMisc::Aviation::CCallsign &callsign);
CDirectPlayPeer(QObject *parent, const BlackMisc::Aviation::CCallsign &callsign);
//! Destructor
virtual ~CDirectPlayPeer();
@@ -91,8 +90,6 @@ namespace BlackSimPlugin
// We need the Id of the users player, because we are sending packets only to him
std::atomic<DPNID> m_playerUser = {0}; //!< User player Id
QMutex m_mutexHostList; //!< Host list mutex
using TCallbackWrapper = CallbackWrapper<CDirectPlayPeer, HRESULT, DWORD, void *>; //!< DirectPlay peer message handler wrapper
TCallbackWrapper m_callbackWrapper; //!< Callback wrapper
};