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 git-svn-id: svn://10.0.0.236/trunk@84525 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
3def6cda68
commit
c87631519f
@ -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);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
@ -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
|
||||
*/
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user