Skip to content

Commit

Permalink
20160830
Browse files Browse the repository at this point in the history
  • Loading branch information
liangdc committed Aug 30, 2016
1 parent f848078 commit 0f29c34
Show file tree
Hide file tree
Showing 351 changed files with 492 additions and 396 deletions.
26 changes: 26 additions & 0 deletions ChangeLog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,29 @@
==========================================================================================
v3.5.4 ���£�
==========================================================================================

> Bug �޸���
-----------------
1���޸� IClient ��������ӷ�������ʱ���ӱ��Ͽ����ܵ��³������ Bug
2���Ż� vc-common-src ����������� CCASQueue

> ����˵����
-----------------
1��HP-Socket v3.5.4 ��ȫ���� HP-Socket v3.5.3 �汾������ֱ���滻����

==========================================================================================
v3.5.3 ���£�
==========================================================================================

> Bug �޸���
-----------------
1���޸� IClient ����ڼ�������´������� OnClose() �¼� Bug
2���޸� IClient ����ڼ������������ IClient �����³������ Bug

> ����˵����
-----------------
1��HP-Socket v3.5.3 ��ȫ���� HP-Socket v3.5.2 �汾������ֱ���滻����

==========================================================================================
v3.5.2 ���£�
==========================================================================================
Expand Down
8 changes: 7 additions & 1 deletion Common/ChangeLog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,17 @@ Module : vc-common-src
Desc : HP-Socket �� VC-Logger ���������
Usage : ����Ҫ�Ĵ����ļ����뵽��Ŀ��

==========================================================================================
v2.3.14 ���£�
==========================================================================================

1���޸� RingBuffer.cpp���޸� CCASQueue �����ڶ���������߳�ʱ�����쳣 Bug

==========================================================================================
v2.3.13 ���£�
==========================================================================================

1���޸� bufferpool.pp���޸� CBufferPool::PutFreeBuffer(TBuffer* pBuffer) û����� Map Bug
1���޸� bufferpool.cpp���޸� CBufferPool::PutFreeBuffer(TBuffer* pBuffer) û����� Map Bug

==========================================================================================
v2.3.12 ���£�
Expand Down
2 changes: 1 addition & 1 deletion Common/License.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Copyright JessMA Open Source (ldcsaa@gmail.com)
*
* Version : 2.3.13
* Version : 2.3.14
* Author : Bruce Liang
* Website : http://www.jessma.org
* Project : https://github.com/ldcsaa
Expand Down
2 changes: 1 addition & 1 deletion Common/Src/CriticalSection.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Copyright: JessMA Open Source (ldcsaa@gmail.com)
*
* Version : 2.3.13
* Version : 2.3.14
* Author : Bruce Liang
* Website : http://www.jessma.org
* Project : https://github.com/ldcsaa
Expand Down
37 changes: 16 additions & 21 deletions Common/Src/CriticalSection.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Copyright: JessMA Open Source (ldcsaa@gmail.com)
*
* Version : 2.3.13
* Version : 2.3.14
* Author : Bruce Liang
* Website : http://www.jessma.org
* Project : https://github.com/ldcsaa
Expand Down Expand Up @@ -33,10 +33,12 @@
#define DEFAULT_CRISEC_SPIN_COUNT 4096

#if defined (_WIN64)
#define DEFAULT_PAUSE_YIELD 32
#define DEFAULT_PAUSE_RETRY 16
#define DEFAULT_PAUSE_YIELD 128
#define DEFAULT_PAUSE_CYCLE 8192
#else
#define DEFAULT_PAUSE_YIELD 8
#define DEFAULT_PAUSE_RETRY 4
#define DEFAULT_PAUSE_YIELD 32
#define DEFAULT_PAUSE_CYCLE 4096
#endif

Expand All @@ -45,6 +47,15 @@
#define YieldProcessor _mm_pause
#endif

static inline void YieldThread(UINT i = DEFAULT_PAUSE_RETRY)
{
if (i < DEFAULT_PAUSE_RETRY) ;
else if (i < DEFAULT_PAUSE_YIELD) YieldProcessor();
else if (i < DEFAULT_PAUSE_CYCLE - 1) SwitchToThread();
else if (i < DEFAULT_PAUSE_CYCLE) Sleep(1);
else YieldThread(i & (DEFAULT_PAUSE_CYCLE - 1));
}

class CInterCriSec
{
public:
Expand Down Expand Up @@ -177,7 +188,7 @@ class CSpinGuard
void Lock()
{
for(UINT i = 0; !TryLock(); ++i)
Pause(i);
YieldThread(i);
}

BOOL TryLock()
Expand All @@ -197,14 +208,6 @@ class CSpinGuard
m_lFlag = 0;
}

static void Pause(UINT i)
{
if (i < DEFAULT_PAUSE_YIELD) YieldProcessor();
else if (i < DEFAULT_PAUSE_CYCLE - 1) SwitchToThread();
else if (i < DEFAULT_PAUSE_CYCLE) Sleep(1);
else Pause(i & (DEFAULT_PAUSE_CYCLE - 1));
}

private:
CSpinGuard(const CSpinGuard& cs);
CSpinGuard operator = (const CSpinGuard& cs);
Expand Down Expand Up @@ -232,7 +235,7 @@ class CReentrantSpinGuard
void Lock()
{
for(UINT i = 0; !_TryLock(i == 0); ++i)
Pause(i);
YieldThread(i);
}

BOOL TryLock()
Expand All @@ -248,14 +251,6 @@ class CReentrantSpinGuard
m_dwThreadID = 0;
}

static void Pause(UINT i)
{
if (i < DEFAULT_PAUSE_YIELD) YieldProcessor();
else if (i < DEFAULT_PAUSE_CYCLE - 1) SwitchToThread();
else if (i < DEFAULT_PAUSE_CYCLE) Sleep(1);
else Pause(i & (DEFAULT_PAUSE_CYCLE - 1));
}

private:
CReentrantSpinGuard(const CReentrantSpinGuard& cs);
CReentrantSpinGuard operator = (const CReentrantSpinGuard& cs);
Expand Down
2 changes: 1 addition & 1 deletion Common/Src/Event.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Copyright: JessMA Open Source (ldcsaa@gmail.com)
*
* Version : 2.3.13
* Version : 2.3.14
* Author : Bruce Liang
* Website : http://www.jessma.org
* Project : https://github.com/ldcsaa
Expand Down
2 changes: 1 addition & 1 deletion Common/Src/Event.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Copyright: JessMA Open Source (ldcsaa@gmail.com)
*
* Version : 2.3.13
* Version : 2.3.14
* Author : Bruce Liang
* Website : http://www.jessma.org
* Project : https://github.com/ldcsaa
Expand Down
2 changes: 1 addition & 1 deletion Common/Src/FuncHelper.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Copyright: JessMA Open Source (ldcsaa@gmail.com)
*
* Version : 2.3.13
* Version : 2.3.14
* Author : Bruce Liang
* Website : http://www.jessma.org
* Project : https://github.com/ldcsaa
Expand Down
2 changes: 1 addition & 1 deletion Common/Src/FuncHelper.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Copyright: JessMA Open Source (ldcsaa@gmail.com)
*
* Version : 2.3.13
* Version : 2.3.14
* Author : Bruce Liang
* Website : http://www.jessma.org
* Project : https://github.com/ldcsaa
Expand Down
2 changes: 1 addition & 1 deletion Common/Src/GeneralHelper.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Copyright: JessMA Open Source (ldcsaa@gmail.com)
*
* Version : 2.3.13
* Version : 2.3.14
* Author : Bruce Liang
* Website : http://www.jessma.org
* Project : https://github.com/ldcsaa
Expand Down
2 changes: 1 addition & 1 deletion Common/Src/GeneralHelper.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Copyright: JessMA Open Source (ldcsaa@gmail.com)
*
* Version : 2.3.13
* Version : 2.3.14
* Author : Bruce Liang
* Website : http://www.jessma.org
* Project : https://github.com/ldcsaa
Expand Down
2 changes: 1 addition & 1 deletion Common/Src/PrivateHeap.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Copyright: JessMA Open Source (ldcsaa@gmail.com)
*
* Version : 2.3.13
* Version : 2.3.14
* Author : Bruce Liang
* Website : http://www.jessma.org
* Project : https://github.com/ldcsaa
Expand Down
2 changes: 1 addition & 1 deletion Common/Src/PrivateHeap.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Copyright: JessMA Open Source (ldcsaa@gmail.com)
*
* Version : 2.3.13
* Version : 2.3.14
* Author : Bruce Liang
* Website : http://www.jessma.org
* Project : https://github.com/ldcsaa
Expand Down
2 changes: 1 addition & 1 deletion Common/Src/RWLock.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Copyright: JessMA Open Source (ldcsaa@gmail.com)
*
* Version : 2.3.13
* Version : 2.3.14
* Author : Bruce Liang
* Website : http://www.jessma.org
* Project : https://github.com/ldcsaa
Expand Down
2 changes: 1 addition & 1 deletion Common/Src/RWLock.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Copyright: JessMA Open Source (ldcsaa@gmail.com)
*
* Version : 2.3.13
* Version : 2.3.14
* Author : Bruce Liang
* Website : http://www.jessma.org
* Project : https://github.com/ldcsaa
Expand Down
2 changes: 1 addition & 1 deletion Common/Src/RingBuffer.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Copyright: JessMA Open Source (ldcsaa@gmail.com)
*
* Version : 2.3.13
* Version : 2.3.14
* Author : Bruce Liang
* Website : http://www.jessma.org
* Project : https://github.com/ldcsaa
Expand Down
2 changes: 1 addition & 1 deletion Common/Src/SE.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Copyright: JessMA Open Source (ldcsaa@gmail.com)
*
* Version : 2.3.13
* Version : 2.3.14
* Author : Bruce Liang
* Website : http://www.jessma.org
* Project : https://github.com/ldcsaa
Expand Down
6 changes: 3 additions & 3 deletions Common/Src/STLHelper.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Copyright: JessMA Open Source (ldcsaa@gmail.com)
*
* Version : 2.3.13
* Version : 2.3.14
* Author : Bruce Liang
* Website : http://www.jessma.org
* Project : https://github.com/ldcsaa
Expand Down Expand Up @@ -47,8 +47,8 @@
#include <hash_set>
#include <hash_map>

#define unorderedhash_set hash_set
#define unordered_map hash_map
#define unordered_set hash_set
#define unordered_map hash_map
#endif


Expand Down
2 changes: 1 addition & 1 deletion Common/Src/Semaphore.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Copyright: JessMA Open Source (ldcsaa@gmail.com)
*
* Version : 2.3.13
* Version : 2.3.14
* Author : Bruce Liang
* Website : http://www.jessma.org
* Project : https://github.com/ldcsaa
Expand Down
2 changes: 1 addition & 1 deletion Common/Src/Semaphore.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Copyright: JessMA Open Source (ldcsaa@gmail.com)
*
* Version : 2.3.13
* Version : 2.3.14
* Author : Bruce Liang
* Website : http://www.jessma.org
* Project : https://github.com/ldcsaa
Expand Down
2 changes: 1 addition & 1 deletion Common/Src/Singleton.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Copyright: JessMA Open Source (ldcsaa@gmail.com)
*
* Version : 2.3.13
* Version : 2.3.14
* Author : Bruce Liang
* Website : http://www.jessma.org
* Project : https://github.com/ldcsaa
Expand Down
2 changes: 1 addition & 1 deletion Common/Src/SysHelper.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Copyright: JessMA Open Source (ldcsaa@gmail.com)
*
* Version : 2.3.13
* Version : 2.3.14
* Author : Bruce Liang
* Website : http://www.jessma.org
* Project : https://github.com/ldcsaa
Expand Down
2 changes: 1 addition & 1 deletion Common/Src/SysHelper.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Copyright: JessMA Open Source (ldcsaa@gmail.com)
*
* Version : 2.3.13
* Version : 2.3.14
* Author : Bruce Liang
* Website : http://www.jessma.org
* Project : https://github.com/ldcsaa
Expand Down
2 changes: 1 addition & 1 deletion Common/Src/Thread.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Copyright: JessMA Open Source (ldcsaa@gmail.com)
*
* Version : 2.3.13
* Version : 2.3.14
* Author : Bruce Liang
* Website : http://www.jessma.org
* Project : https://github.com/ldcsaa
Expand Down
2 changes: 1 addition & 1 deletion Common/Src/Thread.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Copyright: JessMA Open Source (ldcsaa@gmail.com)
*
* Version : 2.3.13
* Version : 2.3.14
* Author : Bruce Liang
* Website : http://www.jessma.org
* Project : https://github.com/ldcsaa
Expand Down
2 changes: 1 addition & 1 deletion Common/Src/WaitFor.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Copyright: JessMA Open Source (ldcsaa@gmail.com)
*
* Version : 2.3.13
* Version : 2.3.14
* Author : Bruce Liang
* Website : http://www.jessma.org
* Project : https://github.com/ldcsaa
Expand Down
2 changes: 1 addition & 1 deletion Common/Src/WaitFor.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Copyright: JessMA Open Source (ldcsaa@gmail.com)
*
* Version : 2.3.13
* Version : 2.3.14
* Author : Bruce Liang
* Website : http://www.jessma.org
* Project : https://github.com/ldcsaa
Expand Down
2 changes: 1 addition & 1 deletion Common/Src/Win32Helper.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Copyright: JessMA Open Source (ldcsaa@gmail.com)
*
* Version : 2.3.13
* Version : 2.3.14
* Author : Bruce Liang
* Website : http://www.jessma.org
* Project : https://github.com/ldcsaa
Expand Down
Loading

0 comments on commit 0f29c34

Please sign in to comment.