mirror of
https://github.com/chatmail/core.git
synced 2026-05-22 08:16:32 +03:00
use boolean for jobs_needed
This commit is contained in:
committed by
holger krekel
parent
01e7caf65a
commit
b9c7510b58
@@ -15,7 +15,7 @@ pub struct JobThread {
|
|||||||
#[derive(Clone, Debug, Default)]
|
#[derive(Clone, Debug, Default)]
|
||||||
pub struct JobState {
|
pub struct JobState {
|
||||||
idle: bool,
|
idle: bool,
|
||||||
jobs_needed: i32,
|
jobs_needed: bool,
|
||||||
suspended: bool,
|
suspended: bool,
|
||||||
using_handle: bool,
|
using_handle: bool,
|
||||||
}
|
}
|
||||||
@@ -58,7 +58,7 @@ impl JobThread {
|
|||||||
|
|
||||||
pub fn interrupt_idle(&self, context: &Context) {
|
pub fn interrupt_idle(&self, context: &Context) {
|
||||||
{
|
{
|
||||||
self.state.0.lock().unwrap().jobs_needed = 1;
|
self.state.0.lock().unwrap().jobs_needed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
info!(context, "Interrupting {}-IDLE...", self.name);
|
info!(context, "Interrupting {}-IDLE...", self.name);
|
||||||
@@ -139,13 +139,13 @@ impl JobThread {
|
|||||||
let &(ref lock, ref cvar) = &*self.state.clone();
|
let &(ref lock, ref cvar) = &*self.state.clone();
|
||||||
let mut state = lock.lock().unwrap();
|
let mut state = lock.lock().unwrap();
|
||||||
|
|
||||||
if 0 != state.jobs_needed {
|
if state.jobs_needed {
|
||||||
info!(
|
info!(
|
||||||
context,
|
context,
|
||||||
"{}-IDLE will not be started as it was interrupted while not ideling.",
|
"{}-IDLE will not be started as it was interrupted while not ideling.",
|
||||||
self.name,
|
self.name,
|
||||||
);
|
);
|
||||||
state.jobs_needed = 0;
|
state.jobs_needed = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user