Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 43903
b: refs/heads/master
c: 4594bf1
h: refs/heads/master
i:
  43901: a1960f5
  43899: 476a93b
  43895: f40817b
  43887: 1497bf9
  43871: 367d2cf
  43839: 42b5abd
  43775: 561312c
v: v3
  • Loading branch information
David Howells authored and Linus Torvalds committed Dec 9, 2006
1 parent 3ec4f01 commit f4245a5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d8a53b358257625778387925165eaa97839b2f52
refs/heads/master: 4594bf159f1962cec3b727954b7c598b07e2e737
21 changes: 9 additions & 12 deletions trunk/kernel/workqueue.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,22 +85,19 @@ static inline int is_single_threaded(struct workqueue_struct *wq)
return list_empty(&wq->list);
}

/*
* Set the workqueue on which a work item is to be run
* - Must *only* be called if the pending flag is set
*/
static inline void set_wq_data(struct work_struct *work, void *wq)
{
unsigned long new, old, res;
unsigned long new;

BUG_ON(!work_pending(work));

/* assume the pending flag is already set and that the task has already
* been queued on this workqueue */
new = (unsigned long) wq | (1UL << WORK_STRUCT_PENDING);
res = work->management;
if (res != new) {
do {
old = res;
new = (unsigned long) wq;
new |= (old & WORK_STRUCT_FLAG_MASK);
res = cmpxchg(&work->management, old, new);
} while (res != old);
}
new |= work->management & WORK_STRUCT_FLAG_MASK;
work->management = new;
}

static inline void *get_wq_data(struct work_struct *work)
Expand Down

0 comments on commit f4245a5

Please sign in to comment.