00001
00005
00006 #include "RefCountServantBase.h"
00007
00008 Sct::RefCountServantBase::~RefCountServantBase() {}
00009
00010
00011 void Sct::RefCountServantBase::_sct_add_ref()
00012 {
00013 boost::mutex::scoped_lock lk(this->m_mutex);
00014
00015
00016
00017
00018
00019
00020
00021 pd_refCount++;
00022 }
00023
00024
00025 void Sct::RefCountServantBase::_sct_remove_ref() {
00026
00027 int done;
00028 {
00029 boost::mutex::scoped_lock lk(this->m_mutex);
00030 done = --pd_refCount > 0;
00031 };
00032
00033 if( done ) return;
00034
00035 if( pd_refCount < 0 ) {
00036
00037 return;
00038 }
00039
00040
00041
00042
00043 this->performCountEqualsZeroAction();
00044 }
00045