Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
693618f1
Commit
693618f1
authored
Sep 15, 2011
by
antirez
Browse files
Remove backgroud jobs from the queue only when the processing was completed, and not just started.
parent
c67e8d3b
Changes
1
Show whitespace changes
Inline
Side-by-side
src/bio.c
View file @
693618f1
...
@@ -118,7 +118,6 @@ void *bioProcessBackgroundJobs(void *arg) {
...
@@ -118,7 +118,6 @@ void *bioProcessBackgroundJobs(void *arg) {
/* Pop the job from the queue. */
/* Pop the job from the queue. */
ln
=
listFirst
(
bio_jobs
[
type
]);
ln
=
listFirst
(
bio_jobs
[
type
]);
job
=
ln
->
value
;
job
=
ln
->
value
;
listDelNode
(
bio_jobs
[
type
],
ln
);
/* It is now possible to unlock the background system as we know have
/* It is now possible to unlock the background system as we know have
* a stand alone job structure to process.*/
* a stand alone job structure to process.*/
pthread_mutex_unlock
(
&
bio_mutex
[
type
]);
pthread_mutex_unlock
(
&
bio_mutex
[
type
]);
...
@@ -134,6 +133,7 @@ void *bioProcessBackgroundJobs(void *arg) {
...
@@ -134,6 +133,7 @@ void *bioProcessBackgroundJobs(void *arg) {
/* Lock again before reiterating the loop, if there are no longer
/* Lock again before reiterating the loop, if there are no longer
* jobs to process we'll block again in pthread_cond_wait(). */
* jobs to process we'll block again in pthread_cond_wait(). */
pthread_mutex_lock
(
&
bio_mutex
[
type
]);
pthread_mutex_lock
(
&
bio_mutex
[
type
]);
listDelNode
(
bio_jobs
[
type
],
ln
);
bio_pending
[
type
]
--
;
bio_pending
[
type
]
--
;
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment