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
This commit is contained in:
8
2001-09-28 18:38:45 +00:00
committed by Michael Zucci
parent dd13860c7a
commit 2ca8993160
2 changed files with 17 additions and 4 deletions

View File

@ -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

View File

@ -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) {
m(printf("put: have pipe, writing notification to it\n"));
write(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(fd, "", 1);
}
m(printf("put: done\n"));
}