~hikiko/nux/arb-srgba-shader

« back to all changes in this revision

Viewing changes to NuxCore/SmartPtr/NRefCount.cpp

  • Committer: Neil Jagdish Patel
  • Date: 2010-09-01 19:25:37 UTC
  • Revision ID: neil.patel@canonical.com-20100901192537-mfz7rm6q262pewg6
Import and build NuxCore

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include "../NKernel.h"
 
2
#include "NRefCount.h"
 
3
 
 
4
NAMESPACE_BEGIN
 
5
 
 
6
NCriticalSection NRefCount::m_CriticalSection;
 
7
 
 
8
NRefCount::NRefCount()
 
9
{
 
10
 
 
11
}
 
12
 
 
13
NRefCount::~NRefCount()
 
14
{
 
15
 
 
16
}
 
17
 
 
18
void NRefCount::Increment()
 
19
{
 
20
    NScopeLock Scope(&m_CriticalSection);
 
21
    m_TSCounter.Increment();
 
22
}
 
23
 
 
24
void NRefCount::Decrement()
 
25
{
 
26
    NScopeLock Scope(&m_CriticalSection);
 
27
    m_TSCounter.Decrement();
 
28
}
 
29
 
 
30
t_u32 NRefCount::GetRefCount() const
 
31
{
 
32
    NScopeLock Scope(&m_CriticalSection);
 
33
    return m_TSCounter.GetValue();
 
34
}
 
35
 
 
36
NAMESPACE_END