Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 02 Jul 1997 00:06:46 -0700 (PDT)
From:      Simon Shapiro <Shimon@i-Connect.Net>
To:        freebsd-hackers@freebsd.org
Subject:   timeout/untimeout - How?
Message-ID:  <XFMail.970702000646.Shimon@i-Connect.Net>

next in thread | raw e-mail | index | archive | help
I KNOW I am doing something foolish.  But what?

[at the beginning of a driver]
...
static void
dpt_timeout_losers(void *dpt);
...

[in dpt_scsi_cmd]
...
  ospl = splbio();
  if ( !(dpt->state & DPT_STATE_LOSERS_TIMEOUT_SET) ) {
    dpt->state |= DPT_STATE_LOSERS_TIMEOUT_SET;
    timeout((timeout_func_t)dpt_timeout_losers, dpt, hz * 10);
  }
  splx(ospl);
...

static void
dpt_timeout_losers(void *arg)
{
  dpt_softc_t *dpt = (dpt_softc_t *)arg;

  if ( !(dpt->state & DPT_STATE_LOSERS_TIMEOUT_ACTIVE) )
    dpt_abort_losers(dpt);

  timeout((timeout_func_t)dpt_timeout_losers, (caddr_t)dpt, hz * 10);
}

What I am trying to do is have the function dpt_abort_losers() run once
every 10 seconds.  (Please don't ask why - nasty hardware problems)

What I am getting is a panic due to timeout table being full.

Where is my stupidity?

Simon





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.970702000646.Shimon>