Branch: Tag:

2019-04-03

2019-04-03 16:17:19 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Runtime: Added API for delaying destruct() during critical sections.

Adds object_inhibit_destruct() and object_permit_destruct() to
temporarily delay explicit destruct() in critical sections.

3672:    if (o->prog && o->prog->flags & PROGRAM_NO_EXPLICIT_DESTRUCT)    PIKE_ERROR("destruct", "Object can't be destructed explicitly.\n",    Pike_sp, args); +  if (o->inhibit_destruct) { +  /* Destruct the object as soon as the inhibit_destruct +  * counter is back down to zero. +  */ +  o->flags |= OBJECT_PENDING_DESTRUCT; +  return; +  }    debug_malloc_touch(o);    destruct_object (o, DESTRUCT_EXPLICIT);    pop_n_elems(args);