diff options
-rw-r--r-- | e-util/ChangeLog | 8 | ||||
-rw-r--r-- | e-util/e-msgport.c | 11 |
2 files changed, 16 insertions, 3 deletions
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 <NotZed@Ximian.com> + + * 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 <clahey@ximian.com> * 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")); } |