diff --git a/widget/src/beos/nsToolkit.cpp b/widget/src/beos/nsToolkit.cpp index c0fa888cffe..9abd876a9e2 100644 --- a/widget/src/beos/nsToolkit.cpp +++ b/widget/src/beos/nsToolkit.cpp @@ -276,7 +276,16 @@ void nsToolkit::CallMethodAsync(MethodInfo *info) id.data = info; id.sync = false; - write_port_etc(eventport, WM_CALLMETHOD, &id, sizeof(id), B_TIMEOUT, 0); + + // Check message count to not exceed the port's capacity. + // There seems to be a BeOS bug that allows more + // messages on a port than its capacity. + port_info portinfo; + if (get_port_info(eventport, &portinfo) != B_OK) + return; + + if (port_count(eventport) < portinfo.capacity - 20) + write_port_etc(eventport, WM_CALLMETHOD, &id, sizeof(id), B_TIMEOUT, 0); } //------------------------------------------------------------------------- diff --git a/xpcom/threads/plevent.c b/xpcom/threads/plevent.c index 366fb727309..2406472c51f 100644 --- a/xpcom/threads/plevent.c +++ b/xpcom/threads/plevent.c @@ -767,7 +767,7 @@ failed: { /* create port */ - self->eventport = create_port(100, portname); + self->eventport = create_port(500, portname); /* We don't use the sem, but it has to be there */