mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
Core/Ptr: Changed to less risky code
git-svn-id: svn://ultimatepp.org/upp/trunk@9393 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
37307612ee
commit
7815dd533e
1 changed files with 2 additions and 5 deletions
|
|
@ -27,13 +27,10 @@ static StaticCriticalSection sPteLock;
|
|||
|
||||
PteBase::Prec *PteBase::PtrAdd()
|
||||
{
|
||||
sPteLock.Enter();
|
||||
if(prec) {
|
||||
CriticalSection::Lock __(sPteLock);
|
||||
if(prec)
|
||||
++prec->n;
|
||||
sPteLock.Leave();
|
||||
}
|
||||
else {
|
||||
sPteLock.Leave();
|
||||
prec = new Prec;
|
||||
prec->n = 1;
|
||||
prec->ptr = this;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue