Logo Search packages:      
Sourcecode: djvulibre version File versions  Download package

GPBase & GPBase::assign ( GPEnabled nptr ) [inherited]

Assignment from pointer. Checks that the object is not being destroyed. Increments the counter of the new value of the pointer. Decrements the counter of the previous value of the pointer.

Definition at line 139 of file GSmartPointer.cpp.

References GPBase::ptr.

{
  if (nptr)
    nptr->ref();
  int volatile *locka = locks+LOCKIDX(this);
  atomicAcquireOrSpin(locka);
  GPEnabled *old = ptr;
  ptr = nptr;
  atomicRelease(locka);
  if (old)
    old->unref();
  return *this;
}

Generated by  Doxygen 1.6.0   Back to index