mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-29 00:27:27 -04:00
Cleanup RsThread and related classes
Removed antipattern abstraction RsSingleJobThread Rename runloop() method to run() in RsThread Ported few classes ineriting from RsSingleJobThread to RsThread RsThread use std::atomic instead of self implemented strange binary semaphores Removed RsTickingThread::shutdown() use RsThread::askForStop() instead Removed RsTickingThread::fullstop() use RsThread::fullstop() instead Stop properly JSON API server in retroshare-gui Centralize errno traslation to literal in util/rserrno.*
This commit is contained in:
parent
358aa1e0ab
commit
df87fe53b1
43 changed files with 490 additions and 587 deletions
|
@ -132,7 +132,7 @@ bool RsGenExchange::getGroupServerUpdateTS(const RsGxsGroupId& gid, rstime_t& gr
|
|||
return mNetService->getGroupServerUpdateTS(gid,grp_server_update_TS,msg_server_update_TS) ;
|
||||
}
|
||||
|
||||
void RsGenExchange::data_tick()
|
||||
void RsGenExchange::threadTick()
|
||||
{
|
||||
static const double timeDelta = 0.1; // slow tick in sec
|
||||
|
||||
|
|
|
@ -176,7 +176,7 @@ public:
|
|||
*/
|
||||
RsTokenService* getTokenService();
|
||||
|
||||
virtual void data_tick();
|
||||
void threadTick() override; /// @see RsTickingThread
|
||||
|
||||
/*!
|
||||
* Policy bit pattern portion
|
||||
|
|
|
@ -1981,7 +1981,7 @@ bool RsGxsNetService::locked_processTransac(RsNxsTransacItem *item)
|
|||
return false;
|
||||
}
|
||||
|
||||
void RsGxsNetService::data_tick()
|
||||
void RsGxsNetService::threadTick()
|
||||
{
|
||||
static const double timeDelta = 0.5;
|
||||
|
||||
|
|
|
@ -76,7 +76,8 @@ struct GroupRequestRecord
|
|||
* Incoming transaction are in 3 different states
|
||||
* 1. START 2. RECEIVING 3. END
|
||||
*/
|
||||
class RsGxsNetService : public RsNetworkExchangeService, public p3ThreadedService, public p3Config
|
||||
class RsGxsNetService :
|
||||
public RsNetworkExchangeService, public p3ThreadedService, public p3Config
|
||||
{
|
||||
public:
|
||||
|
||||
|
@ -207,10 +208,8 @@ public:
|
|||
*/
|
||||
int tick();
|
||||
|
||||
/*!
|
||||
* Processes transactions and job queue
|
||||
*/
|
||||
virtual void data_tick();
|
||||
void threadTick() override; /// @see RsTickingThread
|
||||
|
||||
private:
|
||||
|
||||
/*!
|
||||
|
|
|
@ -726,7 +726,7 @@ void RsGxsNetTunnelService::generateEncryptionKey(const RsGxsGroupId& group_id,c
|
|||
// Service parts //
|
||||
//===========================================================================================================================================//
|
||||
|
||||
void RsGxsNetTunnelService::data_tick()
|
||||
void RsGxsNetTunnelService::threadTick()
|
||||
{
|
||||
while(!mPendingTurtleItems.empty())
|
||||
{
|
||||
|
|
|
@ -103,7 +103,9 @@
|
|||
class RsGxsNetTunnelItem ;
|
||||
class RsNetworkExchangeService ;
|
||||
|
||||
class RsGxsNetTunnelService: public RsTurtleClientService, public RsTickingThread, public p3Config, public RsGxsDistSync
|
||||
class RsGxsNetTunnelService:
|
||||
public RsTurtleClientService, public RsTickingThread, public p3Config,
|
||||
public RsGxsDistSync
|
||||
{
|
||||
public:
|
||||
RsGxsNetTunnelService() ;
|
||||
|
@ -196,9 +198,7 @@ public:
|
|||
virtual bool receiveSearchRequest(unsigned char *search_request_data, uint32_t search_request_data_len, unsigned char *& search_result_data, uint32_t& search_result_data_len, uint32_t &max_allowed_hits);
|
||||
virtual void receiveSearchResult(TurtleSearchRequestId request_id,unsigned char *search_result_data,uint32_t search_result_data_len);
|
||||
|
||||
// Overloaded from RsTickingThread
|
||||
|
||||
void data_tick() ;
|
||||
void threadTick() override; /// @see RsTickingThread
|
||||
|
||||
// Overloads p3Config
|
||||
|
||||
|
|
|
@ -183,7 +183,7 @@ private:
|
|||
* Checks the integrity message and groups
|
||||
* in rsDataService using computed hash
|
||||
*/
|
||||
class RsGxsIntegrityCheck : public RsSingleJobThread
|
||||
class RsGxsIntegrityCheck : public RsThread
|
||||
{
|
||||
|
||||
enum CheckState { CheckStart, CheckChecking };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue