1
0
Fork 0
mirror of https://github.com/deltachat/deltachat-core.git synced 2025-10-05 10:39:27 +02:00

make sure subsequent idle-stops are executed only once

This commit is contained in:
B. Petersen 2018-06-01 12:01:28 +02:00
parent 673f809691
commit e5c862c54d

View file

@ -132,6 +132,7 @@ static void* idle_thread_entry_point(void* entry_arg)
{ {
mrmailbox_t* mailbox = (mrmailbox_t*)entry_arg; mrmailbox_t* mailbox = (mrmailbox_t*)entry_arg;
mrmailbox_idle(mailbox); // this may take hours ... mrmailbox_idle(mailbox); // this may take hours ...
idle_thread_started = 0;
return NULL; return NULL;
} }
@ -150,9 +151,9 @@ static void idle_disconnect(mrmailbox_t* mailbox)
{ {
if( idle_thread_started ) if( idle_thread_started )
{ {
idle_thread_started = 0;
mrmailbox_interrupt_idle(mailbox); mrmailbox_interrupt_idle(mailbox);
pthread_join(idle_thread, NULL); pthread_join(idle_thread, NULL);
idle_thread_started = 0;
} }
} }