pike.git
/
src
/
builtin.cmod
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/src/builtin.cmod:2528:
PIKEFUN void inhibit_destruct() flags ID_PROTECTED|ID_LOCAL; { if (UNLIKELY(THIS->lock_count < 0)) { THIS->lock_count--; } else { THIS->lock_count++; } }
+
/**
+
* Inhibit explicit destruction of this object.
+
*
+
* @param inh Inherit level for the inherit of InhibitDestruct
+
* in the current program.
+
*/
+
PMOD_EXPORT void inhibit_destruct(int inh)
+
{
+
apply_current(Pike_fp->current_program->inherits[inh].identifier_level +
+
f_InhibitDestruct_inhibit_destruct_fun_num, 0);
+
pop_stack();
+
}
+
/*! @decl void permit_destruct() *! *! Allow explicit destruction of this object again. *! *! @seealso *! @[inhibit_destruct()], @[_destruct()], *! @[destruct()], @[lfun::_destruct()] */ PIKEFUN void permit_destruct() flags ID_PROTECTED|ID_LOCAL;
pike.git/src/builtin.cmod:2556:
* * Time to die. */ destruct(Pike_fp->current_object); } } else { THIS->lock_count--; } }
+
/**
+
* Allow explicit destruction of this object again.
+
*
+
* @param inh Inherit level for the inherit of InhibitDestruct
+
* in the current program.
+
*/
+
PMOD_EXPORT void permit_destruct(int inh)
+
{
+
apply_current(Pike_fp->current_program->inherits[inh].identifier_level +
+
f_InhibitDestruct_permit_destruct_fun_num, 0);
+
pop_stack();
+
}
+
/*! @decl int(0..1) _destruct(int|void reason) *! *! Returns @expr{1@} when @[inhibit_destruct()] has been *! called more times than @[permit_destruct()]. *! *! @seealso *! @[inhibit_destruct()], @[permit_destruct()], *! @[destruct()], @[lfun::_destruct()] */ PIKEFUN int(0..1) _destruct(int|void reason)