+static int mbox_check_mailbox (CONTEXT* ctx, int* index_hint, int lock) {
+ int rc = 0;
+
+ if (lock) {
+ mutt_block_signals ();
+ if (mbox_lock_mailbox (ctx, 0, 0) == -1) {
+ mutt_unblock_signals ();
+ return M_LOCKED;
+ }
+ }
+
+ rc = _mbox_check_mailbox (ctx, index_hint);
+
+ if (lock) {
+ mutt_unblock_signals ();
+ mbox_unlock_mailbox (ctx);
+ }
+ return rc;
+}
+