Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 1 Jul 2015 15:29:57 -0700
From:      Jack Vogel <jfvogel@gmail.com>
To:        Ryan Stone <rysto32@gmail.com>
Cc:        Konstantin Belousov <kostikbel@gmail.com>, FreeBSD Current <freebsd-current@freebsd.org>
Subject:   Re: How should a driver shutdown a taskqueue on detach?
Message-ID:  <CAFOYbckO-xaHs8vLnb03qUH-%2B26yvExsR2FHg3SvTGRZr13QxQ@mail.gmail.com>
In-Reply-To: <CAFMmRNyeEp0gccRAspkJNT_tFWZvJWEczNitB8nCyOzSWKZBWA@mail.gmail.com>
References:  <CAFMmRNxLV0Uk9iT%2BU8rrPvn6aanSfEA6p577McM=_4xypaZr5w@mail.gmail.com> <CAFOYbckF7brPikTPaf%2BZhdm-R9d0WzygY9-eUxnrmi3p%2BBFBoQ@mail.gmail.com> <CAFMmRNzLL-K0kw_cj==kWpiocOcBLzxU2o6ONGaZRiv5tdSHxQ@mail.gmail.com> <20150701213241.GG2080@kib.kiev.ua> <CAFMmRNyeEp0gccRAspkJNT_tFWZvJWEczNitB8nCyOzSWKZBWA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Ya, that seems elegant.

Jack


On Wed, Jul 1, 2015 at 3:28 PM, Ryan Stone <rysto32@gmail.com> wrote:

> On Wed, Jul 1, 2015 at 5:32 PM, Konstantin Belousov <kostikbel@gmail.com>
> wrote:
>
>> Do you mean, you want some KPI like
>>         boolean taskqueue_is_draining(struct taskqueue *p);
>> so that e.g. executed task could see if it is executing in the
>> shutdown state ?
>
>
> I'd prefer a KPI that stops a taskqueue from accepting new tasks (and
> drops attempts to enqueue on the floor).  Then I could do something like:
>
> taskqueue_stop()
> disable_interrupts()
> taskqueue_drain_all()
> taskqueue_free()
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAFOYbckO-xaHs8vLnb03qUH-%2B26yvExsR2FHg3SvTGRZr13QxQ>