Beispiel #1
0
void
chldcb_check ()
{
  for (;;) {
    int status;
    pid_t pid = waitpid (-1, &status, WNOHANG);
    if (pid == 0 || pid == -1)
      break;
    if (child *c = chldcbs[pid]) {
      chldcbs.remove (c);
#ifdef WRAP_DEBUG
      if (callback_trace & CBTR_CHLD)
	warn ("CALLBACK_TRACE: %schild pid %d (status %d) %s <- %s\n",
	      timestring (), pid, status, c->cb->dest, c->cb->line);
#endif /* WRAP_DEBUG */
      STOP_ACHECK_TIMER ();
      sfs_leave_sel_loop ();
      (*c->cb) (status);
      START_ACHECK_TIMER ();
      delete c;
    } else if (sfs_core::g_zombie_collect) {
      zombie_t *z = zombies[pid];
      if (z) {
	z->_status = status;
      } else {
	zombies.insert (New zombie_t (pid, status));
      }
    }
  }
}
Beispiel #2
0
void
closesim::fhfree (fhtimer *fht)
{
  assert (fht->serv == this);
  fq->timeq.remove (fht);
  fhtab.remove (fht);
  fq->minopen++;
  delete fht;
}
Beispiel #3
0
void
chldcb (pid_t pid, cbi::ptr cb)
{
  if (child *c = chldcbs[pid]) {
    chldcbs.remove (c);
    delete c;
  }

  zombie_t *z;
  if ((z = zombies[pid])) {
    int s = z->_status;
    zombies.remove (z);
    delete z;
    if (cb) 
      (*cb) (s);
  } else if (cb) {
    chldcbs.insert (New child (pid, cb));
  }
}
Beispiel #4
0
inline
objref::~objref ()
{
  objreftab.remove (this);
}
sfssrv_exec::~sfssrv_exec ()
{
  exectab.remove (this);
}
Beispiel #6
0
afsdirentry::~afsdirentry ()
{
  node->remlink ();
  dir->entries.remove (this);
  cookietab.remove (this);
}
Beispiel #7
0
client::~client ()
{
  clienttab.remove (this);
}