mirror of
https://gitee.com/TarsCloud/TarsCpp.git
synced 2024-12-22 22:16:38 +08:00
fix adapter proxy bug
This commit is contained in:
parent
97c46b8411
commit
08cddb7d4b
@ -1826,8 +1826,8 @@ void EndpointThread::getEndpoints(vector<EndpointInfo> &activeEndPoint, vector<E
|
||||
}
|
||||
|
||||
{
|
||||
|
||||
TC_ThreadLock::Lock lock(_lock);
|
||||
TC_LockT<TC_SpinLock> lock(_mutex);
|
||||
// TC_ThreadLock::Lock lock(_mutex);
|
||||
|
||||
refreshReg(_type,_name);
|
||||
|
||||
@ -1846,7 +1846,7 @@ void EndpointThread::getTCEndpoints(vector<TC_Endpoint> &activeEndPoint, vector<
|
||||
|
||||
{
|
||||
|
||||
TC_ThreadLock::Lock lock(_lock);
|
||||
TC_LockT<TC_SpinLock> lock(_mutex);
|
||||
|
||||
refreshReg(_type,_name);
|
||||
|
||||
@ -1859,7 +1859,7 @@ void EndpointThread::notifyEndpoints(const set<EndpointInfo> & active, const set
|
||||
{
|
||||
if(!bSync)
|
||||
{
|
||||
TC_ThreadLock::Lock lock(_lock);
|
||||
TC_LockT<TC_SpinLock> lock(_mutex);
|
||||
|
||||
update(active, inactive);
|
||||
}
|
||||
@ -1975,7 +1975,7 @@ void EndpointManagerThread::getTCEndpointByStation(const string sName, vector<TC
|
||||
|
||||
EndpointThread * EndpointManagerThread::getEndpointThread(GetEndpointType type,const string & sName)
|
||||
{
|
||||
TC_ThreadLock::Lock lock(_lock);
|
||||
TC_LockT<TC_SpinLock> lock(_mutex);
|
||||
|
||||
string sAllName = TC_Common::tostr((int)type) + ":" + sName;
|
||||
|
||||
|
@ -17,6 +17,7 @@
|
||||
#ifndef __TARS_ENDPOINT_MANAGER_H_
|
||||
#define __TARS_ENDPOINT_MANAGER_H_
|
||||
|
||||
#include "util/tc_spin_lock.h"
|
||||
#include "util/tc_consistent_hash_new.h"
|
||||
#include "servant/EndpointInfo.h"
|
||||
#include "servant/EndpointF.h"
|
||||
@ -362,7 +363,8 @@ private:
|
||||
/*
|
||||
* 根据hash值选取一个结点
|
||||
*/
|
||||
AdapterProxy* getHashProxy(int64_t hashCode, bool bConsistentHash = false);
|
||||
AdapterProxy* getHashProxy(int64_t hashCode, bool bConsistentHash = false);
|
||||
|
||||
|
||||
/*
|
||||
* 根据hash值按取模方式,从正常节点中选取一个结点
|
||||
@ -585,7 +587,8 @@ private:
|
||||
/*
|
||||
* 锁
|
||||
*/
|
||||
TC_ThreadLock _lock;
|
||||
// TC_ThreadLock _mutex;
|
||||
TC_SpinLock _mutex;
|
||||
|
||||
|
||||
/*
|
||||
@ -680,7 +683,8 @@ private:
|
||||
/*
|
||||
* 锁
|
||||
*/
|
||||
TC_ThreadLock _lock;
|
||||
// TC_ThreadLock _mutex;
|
||||
TC_SpinLock _mutex;
|
||||
|
||||
/*
|
||||
* 保存对象的map
|
||||
|
Loading…
Reference in New Issue
Block a user