Messages in this thread | | | Date | Mon, 14 Dec 2009 17:02:51 -0500 (EST) | From | Alan Stern <> | Subject | Re: Warn people about flush_scheduled_work() |
| |
On Mon, 14 Dec 2009, Oliver Neukum wrote:
> Am Montag, 14. Dezember 2009 22:33:38 schrieb Alan Stern: > > Consider using cancel_work_sync() or cancel_delayed_work_sync() > > instead. In most situations they will accomplish what you > > need. > > In which respect is cancel_work_sync() fundamentally safer? > If the work is already running and takes a lock you are holding, > then what?
With cancel_work_sync() you _know_ what locks the work item is going to take, since it's your work item. With flush_scheduled_work() you have no idea what locks will be needed by the items on the queue. They could come from anywhere.
Alan Stern
| |