# HG changeset patch # User Timo Sirainen # Date 1122027738 -10800 # Node ID 98cf57713f0a51a7e6cca60b2ecb53e2049856c0 # Parent 35be29ba348d32fd74998f623c1ed1c5c91887db added extra assert for checking deadlocks diff -r 35be29ba348d -r 98cf57713f0a src/lib-storage/index/mbox/mbox-lock.c --- a/src/lib-storage/index/mbox/mbox-lock.c Fri Jul 22 13:14:58 2005 +0300 +++ b/src/lib-storage/index/mbox/mbox-lock.c Fri Jul 22 13:22:18 2005 +0300 @@ -1,6 +1,7 @@ /* Copyright (C) 2002 Timo Sirainen */ #include "lib.h" +#include "mail-index-private.h" #include "mbox-storage.h" #include "mbox-file.h" #include "mbox-lock.h" @@ -517,6 +518,9 @@ i_assert(lock_type == F_RDLCK || lock_type == F_WRLCK); i_assert(lock_type == F_RDLCK || mbox->mbox_lock_type != F_RDLCK); + /* mbox must be locked before index */ + i_assert(mbox->ibox.index->lock_type != F_WRLCK); + if (mbox->mbox_lock_type == F_UNLCK) { ret = mbox_update_locking(mbox, lock_type); if (ret <= 0)