Index: openacs-4/packages/acs-mail/tcl/acs-mail-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-mail/tcl/acs-mail-procs.tcl,v diff -u -r1.9 -r1.9.4.1 --- openacs-4/packages/acs-mail/tcl/acs-mail-procs.tcl 3 Oct 2003 12:31:28 -0000 1.9 +++ openacs-4/packages/acs-mail/tcl/acs-mail-procs.tcl 23 Nov 2005 03:49:22 -0000 1.9.4.1 @@ -399,7 +399,13 @@ } { Process the outgoing message queue. } { - db_foreach acs_message_send { + # Make sure that only one thread is processing the queue at a time. + if {[nsv_incr acs_mail process_queue_p] > 1} { + nsv_incr acs_mail process_queue_p -1 + return + } + + db_foreach acs_message_send { select message_id, envelope_from, envelope_to from acs_mail_queue_outgoing } {