зеркало из https://github.com/mozilla/pjs.git
Increase BeOS event port capacity and avoid sending messages to event port if capacity is exceeded.
Thanks to Makoto Hamanaka <VYA04230@nifty.com> for the patch. Bug #63646. r=danm
This commit is contained in:
Родитель
8f904bb2e8
Коммит
b39aab214f
|
@ -276,7 +276,16 @@ void nsToolkit::CallMethodAsync(MethodInfo *info)
|
||||||
|
|
||||||
id.data = info;
|
id.data = info;
|
||||||
id.sync = false;
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
|
|
|
@ -767,7 +767,7 @@ failed:
|
||||||
{
|
{
|
||||||
/* create port
|
/* 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
|
/* We don't use the sem, but it has to be there
|
||||||
*/
|
*/
|
||||||
|
|
Загрузка…
Ссылка в новой задаче