mirror of
https://bitbucket.org/theswgsource/src-1.2.git
synced 2026-07-28 23:16:15 -04:00
Added ChatServer and soePlatform
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
// Copyright 2004 Sony Online Entertainment, all rights reserved.
|
||||
// Author: Jeff Petersen
|
||||
|
||||
#include <assert.h>
|
||||
#include <time.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "UdpLibrary.h"
|
||||
|
||||
namespace UdpLibrary
|
||||
{
|
||||
|
||||
////////////////////////////////////////////////////////
|
||||
// UdpGuardedRefCount
|
||||
////////////////////////////////////////////////////////
|
||||
void UdpGuardedRefCount::AddRef() const
|
||||
{
|
||||
UdpGuard guard(&mGuard);
|
||||
UdpRefCount::AddRef();
|
||||
}
|
||||
|
||||
void UdpGuardedRefCount::Release() const
|
||||
{
|
||||
mGuard.Enter();
|
||||
assert(!mNoRef);
|
||||
assert(mRefCount > 0);
|
||||
bool done = (--mRefCount == 0);
|
||||
mGuard.Leave();
|
||||
|
||||
if (done)
|
||||
{
|
||||
delete this;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
} // namespace
|
||||
Reference in New Issue
Block a user