Tweak coalescing

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/ec/trunk@38310 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2015-01-30 10:00:16 +00:00
parent 6df29dd4fe
commit 2ec7dc6bad
2 changed files with 24 additions and 0 deletions

View file

@ -1,4 +1,12 @@
2015-01-30 Richard Frith-Macdonald <rfm@gnu.org>
* EcAlarmDestination.m: When coalescing alarms, do not coalesce a
clear with anything other than an earlier clear for the same event.
We do not want to risk forwarding a clear without a preceding
event raising the alarm.
2015-01-26 Richard Frith-Macdonald <rfm@gnu.org>
* GNUmakefile.preamble: fixup gcc flag filtering
* EcClientI.h:
* EcClientI.m:

View file

@ -71,6 +71,22 @@
{
[_alarmQueue addObject: event];
}
else if ([event perceivedSeverity] == EcAlarmSeverityCleared)
{
NSUInteger index;
/* Event clears may only be coalesced with other clears,
* otherwise we might have a case where a clear is sent
* to the alarm sink without a corresponding alarm having
* been raised.
*/
index = [_alarmQueue indexOfObject: event];
[_alarmQueue addObject: event];
if (NSNotFound != index)
{
[_alarmQueue removeObjectAtIndex: index];
}
}
else
{
[event retain];