Re: workqueue question.

From: Tejun Heo
Date: Wed Jun 29 2011 - 04:43:44 EST


Hello,

On Tue, Jun 28, 2011 at 11:56:39AM -0700, Ben Greear wrote:
> Is it OK to call INIT_WORK(&foo, bar)
> if we are currently being called by the work-queue
> using foo?

Yes, but if flush_work*() races with it, flushing can finish before
execution is complete.

> Also, is it valid to free the memory containing foo
> in a workqueue callback?

Yeap.

--
tejun
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/