summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--generic/tclAsync.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/generic/tclAsync.c b/generic/tclAsync.c
index 5116cbd..f219078 100644
--- a/generic/tclAsync.c
+++ b/generic/tclAsync.c
@@ -531,9 +531,15 @@ Tcl_AsyncMark(
packet.token = (AsyncHandler *) token;
rc = TclChanWrite(sharedData.writeChan, (char *) &packet, sizeof(packet));
- if (rc != sizeof(packet)) {
+ /*
+ * If write fails because the channel is full, simply drop the message.
+ * Something has to give under signal handler constraints!
+ * FIXME: windows?
+ */
+ if (rc == -1 && Tcl_GetErrno() == EAGAIN) {
+ DEBUG("Got EAGAIN - dropping packet!");
+ } else if (rc != sizeof(packet)) {
Tcl_Panic("Tcl_AsyncMark: write error or short write to async pipe rc = %d[%d], errno = %d", rc, sizeof(packet), errno);
- return;
}
}