Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 168819
b: refs/heads/master
c: 31ba99d
h: refs/heads/master
i:
  168817: 4ea6abf
  168815: 12b510a
v: v3
  • Loading branch information
David Howells committed Nov 19, 2009
1 parent 0085384 commit d6cd338
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8fba10a42d191de612e60e7009c8f0313f90a9b3
refs/heads/master: 31ba99d304494cb28fa8671ccc769c5543e1165d
15 changes: 15 additions & 0 deletions trunk/Documentation/slow-work.txt
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,21 @@ from being taken away before it completes. module should almost certainly be
THIS_MODULE.


================
HELPER FUNCTIONS
================

The slow-work facility provides a function by which it can be determined
whether or not an item is queued for later execution:

bool queued = slow_work_is_queued(struct slow_work *work);

If it returns false, then the item is not on the queue (it may be executing
with a requeue pending). This can be used to work out whether an item on which
another depends is on the queue, thus allowing a dependent item to be queued
after it.


===============
ITEM OPERATIONS
===============
Expand Down
19 changes: 19 additions & 0 deletions trunk/include/linux/slow-work.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,25 @@ static inline void vslow_work_init(struct slow_work *work,
INIT_LIST_HEAD(&work->link);
}

/**
* slow_work_is_queued - Determine if a slow work item is on the work queue
* work: The work item to test
*
* Determine if the specified slow-work item is on the work queue. This
* returns true if it is actually on the queue.
*
* If the item is executing and has been marked for requeue when execution
* finishes, then false will be returned.
*
* Anyone wishing to wait for completion of execution can wait on the
* SLOW_WORK_EXECUTING bit.
*/
static inline bool slow_work_is_queued(struct slow_work *work)
{
unsigned long flags = work->flags;
return flags & SLOW_WORK_PENDING && !(flags & SLOW_WORK_EXECUTING);
}

extern int slow_work_enqueue(struct slow_work *work);
extern void slow_work_cancel(struct slow_work *work);
extern int slow_work_register_user(struct module *owner);
Expand Down

0 comments on commit d6cd338

Please sign in to comment.