@ -48,6 +48,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
# include "../../Pch.h"
# pragma hdrstop
# include "hsRefCnt.h"
/*****************************************************************************
*
@ -55,7 +57,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*
* * */
struct AsyncThreadTaskList : AtomicRef {
struct AsyncThreadTaskList : hs AtomicRefCnt {
ENetError error ;
AsyncThreadTaskList ( ) ;
~ AsyncThreadTaskList ( ) ;
@ -79,7 +81,7 @@ static HANDLE s_taskPort;
//===========================================================================
AsyncThreadTaskList : : AsyncThreadTaskList ( )
: error ( kNetSuccess )
: hsAtomicRefCnt ( 0 ) , error ( kNetSuccess )
{
PerfAddCounter ( kAsyncPerfThreadTaskListCount , 1 ) ;
}
@ -139,7 +141,7 @@ static unsigned THREADCALL ThreadTaskProc (AsyncThread * thread) {
if ( task ) {
task - > callback ( task - > param , task - > taskList - > error ) ;
task - > taskList - > Dec Ref( " task " ) ;
task - > taskList - > Ref ( " task " ) ;
delete task ;
}
}
@ -227,7 +229,7 @@ void AsyncThreadTaskSetThreadCount (unsigned threads) {
AsyncThreadTaskList * AsyncThreadTaskListCreate ( ) {
ASSERT ( s_taskPort ) ;
AsyncThreadTaskList * taskList = new AsyncThreadTaskList ;
taskList - > Inc Ref( " TaskList " ) ;
taskList - > Ref ( " TaskList " ) ;
return taskList ;
}
@ -241,7 +243,7 @@ void AsyncThreadTaskListDestroy (
ASSERT ( ! taskList - > error ) ;
taskList - > error = error ;
taskList - > Dec Ref( ) ; // REF:TaskList
taskList - > Un Ref( ) ; // REF:TaskList
}
//===========================================================================
@ -263,7 +265,7 @@ void AsyncThreadTaskAdd (
task - > callback = callback ;
task - > param = param ;
StrCopy ( task - > debugStr , debugStr , arrsize ( task - > debugStr ) ) ; // this will be sent with the deadlock checker email if this thread exceeds time set in plServer.ini
taskList - > Inc Ref( " Task " ) ;
taskList - > Ref ( " Task " ) ;
PostQueuedCompletionStatus ( s_taskPort , 0 , ( DWORD ) task , NULL ) ;
}