aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author8 <NotZed@Ximian.com>2001-09-29 02:38:45 +0800
committerMichael Zucci <zucchi@src.gnome.org>2001-09-29 02:38:45 +0800
commit2ca8993160f6efd0edc6ac22fb850241d57bd5af (patch)
tree30ab7983f0b696248573b48b39a188ec94ac9035
parentdd13860c7a9ee912d8fd1ba996a7a1b1bc7bb83e (diff)
downloadgsoc2013-evolution-2ca8993160f6efd0edc6ac22fb850241d57bd5af.tar
gsoc2013-evolution-2ca8993160f6efd0edc6ac22fb850241d57bd5af.tar.gz
gsoc2013-evolution-2ca8993160f6efd0edc6ac22fb850241d57bd5af.tar.bz2
gsoc2013-evolution-2ca8993160f6efd0edc6ac22fb850241d57bd5af.tar.lz
gsoc2013-evolution-2ca8993160f6efd0edc6ac22fb850241d57bd5af.tar.xz
gsoc2013-evolution-2ca8993160f6efd0edc6ac22fb850241d57bd5af.tar.zst
gsoc2013-evolution-2ca8993160f6efd0edc6ac22fb850241d57bd5af.zip
Write the pipe notification outside the lock. This way if the pipe fills
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. svn path=/trunk/; revision=13218
-rw-r--r--e-util/ChangeLog8
-rw-r--r--e-util/e-msgport.c11
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"));
}