[comp.mail.mush] race condition in tool mode when "Done"

del@thrush.semi.harris-atd.com (Don Lewis) (11/22/89)

I just ran into some sort of race condition between when I hit the
"Done" button in tool mode and when a piece of mail was delivered to me.
Mush didn't notice this piece of mail until the next piece was delivered
to me a several minutes later.  I did a trace on it and it was periodically
stat()'ing /var/spool/mail/del.  Unfortunately I don't recall if my mail
spool file needed to be updated or not when I hit "Done".  I can't seem
to reproduce it now though and I don't see anything obviously wrong.

Darn.  It looks like I may have gone and broken something.
--
Don "Truck" Lewis                                     Harris Semiconductor
Internet (if you're lucky): del@semi.harris-atd.com   PO Box 883   MS 62A-028
Internet (if not): del%thrush@trantor.harris-atd.com  Melbourne, FL  32901
UUCP (works): rutgers!soleil!thrush!del               Phone: (407) 729-5205

schaefer@cse.ogi.edu (Barton E. Schaefer) (11/26/89)

This reply address failed after 3 days of "hostname lookup failure":
    To: del@thrush.semi.harris-atd.com
so I'm posting this.  Not an Official Patch; applies to 7.0.0.0 alpha
version of mush only.

In article <1989Nov22.082512.17046@semi.harris-atd.com> del writes:
} I just ran into some sort of race condition between when I hit the
} "Done" button in tool mode and when a piece of mail was delivered to me.

You're using 7.0.0.0, correct?  There is a bug in check_new_mail().  I'm
not sure whether this solves the problem you had or not.

signals.c.0	Mon Aug 28 10:18:08 1989
--- signals.c	Mon Sep 18 14:11:01 1989
***************
*** 229,236 ****
  	    (void) emptyfile(&tmpf, tempfile);
  	current_msg = msg_cnt = 0;
      }
      if (last_spool_size != spool_size) {
- 	(void) load_folder(mailfile, 1, NULL);
  	if (update_size)
  	    last_spool_size = spool_size;
  	if (msg_cnt < last_msg_cnt)
--- 229,236 ----
  	    (void) emptyfile(&tmpf, tempfile);
  	current_msg = msg_cnt = 0;
      }
+     (void) load_folder(mailfile, 1, NULL);
      if (last_spool_size != spool_size) {
  	if (update_size)
  	    last_spool_size = spool_size;
  	if (msg_cnt < last_msg_cnt)