mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-11 10:35:22 -04:00
created 2 subclasses of RsThread, one for ticking services, and one for single shot jobs. Now all threads use the same base code.
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@8288 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
f2d4a237ca
commit
e9b9dce9f5
28 changed files with 317 additions and 335 deletions
|
@ -74,7 +74,7 @@ class RsPluginManager;
|
|||
//int InitRetroShare(int argc, char **argv, RsInit *config);
|
||||
//int LoadCertificates(RsInit *config);
|
||||
|
||||
class RsServer: public RsControl, public RsThread
|
||||
class RsServer: public RsControl, public RsTickingThread
|
||||
{
|
||||
public:
|
||||
/****************************************/
|
||||
|
@ -88,7 +88,7 @@ class RsServer: public RsControl, public RsThread
|
|||
virtual ~RsServer();
|
||||
|
||||
/* Thread Fn: Run the Core */
|
||||
virtual void run();
|
||||
virtual void data_tick();
|
||||
|
||||
/* locking stuff */
|
||||
void lockRsCore()
|
||||
|
@ -120,7 +120,7 @@ class RsServer: public RsControl, public RsThread
|
|||
/* Config */
|
||||
|
||||
virtual void ConfigFinalSave( );
|
||||
virtual void startServiceThread(RsThread *t) ;
|
||||
virtual void startServiceThread(RsTickingThread *t) ;
|
||||
|
||||
/************* Rs shut down function: in upnp 'port lease time' bug *****************/
|
||||
|
||||
|
@ -162,7 +162,7 @@ class RsServer: public RsControl, public RsThread
|
|||
|
||||
// This list contains all threaded services. It will be used to shut them down properly.
|
||||
|
||||
std::list<RsThread*> mRegisteredServiceThreads ;
|
||||
std::list<RsTickingThread*> mRegisteredServiceThreads ;
|
||||
|
||||
/* GXS */
|
||||
// p3Wiki *mWiki;
|
||||
|
@ -184,6 +184,16 @@ class RsServer: public RsControl, public RsThread
|
|||
|
||||
// Worker Data.....
|
||||
|
||||
int mMin ;
|
||||
int mLoop ;
|
||||
int mLastts ;
|
||||
long mLastSec ;
|
||||
double mAvgTickRate ;
|
||||
double mTimeDelta ;
|
||||
|
||||
static const double minTimeDelta = 0.1; // 25;
|
||||
static const double maxTimeDelta = 0.5;
|
||||
static const double kickLimit = 0.15;
|
||||
};
|
||||
|
||||
/* Helper function to convert windows paths
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue