From 3d98d98e5577c3744c21f13053ba1fc5423c346b Mon Sep 17 00:00:00 2001 From: "B. Petersen" Date: Tue, 12 Jun 2018 23:46:54 +0200 Subject: [PATCH] protect fake-idle against spurious wakeups --- src/mrimap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mrimap.c b/src/mrimap.c index 504d94c4..ee106bc6 100644 --- a/src/mrimap.c +++ b/src/mrimap.c @@ -956,7 +956,7 @@ void mrimap_watch_n_wait(mrimap_t* imap) mrmailbox_log_info(imap->m_mailbox, 0, "IMAP-watch-thread waits %i seconds.", (int)seconds_to_wait); pthread_mutex_lock(&imap->m_watch_condmutex); - if( imap->m_watch_condflag == 0 ) { + while( imap->m_watch_condflag == 0 ) { struct timespec timeToWait; timeToWait.tv_sec = time(NULL)+seconds_to_wait; timeToWait.tv_nsec = 0;