From 2ca8993160f6efd0edc6ac22fb850241d57bd5af Mon Sep 17 00:00:00 2001 From: 8 Date: Fri, 28 Sep 2001 18:38:45 +0000 Subject: Write the pipe notification outside the lock. This way if the pipe fills 2001-09-28 * e-msgport.c (e_msgport_put): Write the pipe notification outside the lock. This way if the pipe fills up because of too many outstanding request, the queue isn't deadlocked. This only happens wiht 4096 outstanding messages, so something is getting VERY busy! Fixes #11121. svn path=/trunk/; revision=13218 --- e-util/ChangeLog | 8 ++++++++ e-util/e-msgport.c | 11 ++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) (limited to 'e-util') diff --git a/e-util/ChangeLog b/e-util/ChangeLog index 5233e27103..ace42f88d9 100644 --- a/e-util/ChangeLog +++ b/e-util/ChangeLog @@ -1,3 +1,11 @@ +2001-09-28 + + * e-msgport.c (e_msgport_put): Write the pipe notification outside + the lock. This way if the pipe fills up because of too many + outstanding request, the queue isn't deadlocked. This only + happens wiht 4096 outstanding messages, so something is getting + VERY busy! Fixes #11121. + 2001-09-24 Christopher James Lahey * e-categories-master-list-wombat.c (ecmlw_load, ecmlw_save): Make diff --git a/e-util/e-msgport.c b/e-util/e-msgport.c index aad3648615..2bb4311b18 100644 --- a/e-util/e-msgport.c +++ b/e-util/e-msgport.c @@ -155,6 +155,8 @@ int e_msgport_fd(EMsgPort *mp) void e_msgport_put(EMsgPort *mp, EMsg *msg) { + int fd; + m(printf("put:\n")); g_mutex_lock(mp->lock); e_dlist_addtail(&mp->queue, &msg->ln); @@ -162,11 +164,14 @@ void e_msgport_put(EMsgPort *mp, EMsg *msg) m(printf("put: condwait > 0, waking up\n")); g_cond_signal(mp->cond); } - if (mp->pipe.fd.write != -1) { + fd = mp->pipe.fd.write; + g_mutex_unlock(mp->lock); + + if (fd != -1) { m(printf("put: have pipe, writing notification to it\n")); - write(mp->pipe.fd.write, "", 1); + write(fd, "", 1); } - g_mutex_unlock(mp->lock); + m(printf("put: done\n")); } -- cgit v1.2.3