88eaa834d0
This fixes an issue for missing HW events when out of HW events. We cannot determine whether a HW event has occurred unless we call the underlying drivers with hsaKmtWaitOnMultipleEvents_Ext. Previous logic in Signal::WaitAny would switch to ACTIVE_WAIT state if we run out of hardware events (signal->EopEvent() == NULL) and this would cause the hsaKmtWaitOnMultipleEvents_Ext call to be skipped. But also, when we have some signals without hardware events, calling hsaKmtWaitOnMultipleEvents_Ext with a timeout of 0 so that we can poll for remaining signals adds overhead with an IOCTL call and may cause extra delay. Separating AsyncEventLoop into two separate threads so that: 1. We can have a new Signal::WaitAnyExceptions to wait for HW events This function can be simpler as it does not have to perform all the timer calculations because it is expected to be always waiting on hsaKmtWaitOnMultipleEvents_Ext through the lifetime of a process. 2. Signal::WaitAny does not need to have extra code to check for HW exceptions as it only needs to handle HSA_EVENTTYPE_SIGNAL events. It can also skip the calls to hsaKmtWaitOnMultipleEvents_Ext if needed. Change-Id: I52ba99fd6e483e0cb477b7931a0dcc03520aa523 Signed-off-by: David Yat Sin <David.YatSin@amd.com>