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:
cls%seawood.org 2001-01-07 09:03:09 +00:00
Родитель 8f904bb2e8
Коммит b39aab214f
2 изменённых файлов: 11 добавлений и 2 удалений

Просмотреть файл

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