libhsakmt: add event age tracking
Keeping last signaled event age to avoid race conditions for HSA_EVENTTYPE_SIGNAL when event age init value is non-zero. Change-Id: Ifb9a11a6868e5762a9f92f579e45a0a2c8fa1017 Signed-off-by: James Zhu <James.Zhu@amd.com>
Este cometimento está contido em:
@@ -243,6 +243,25 @@ hsaKmtWaitOnEvent(
|
||||
HSAuint32 Milliseconds //IN
|
||||
);
|
||||
|
||||
/**
|
||||
Checks the current state of the event object. If the object's state is
|
||||
nonsignaled, the calling thread enters the wait state. event_age can
|
||||
help avoiding race conditions.
|
||||
|
||||
The function returns when one of the following occurs:
|
||||
- The specified event object is in the signaled state.
|
||||
- The time-out interval elapses.
|
||||
- Tracking event age
|
||||
*/
|
||||
|
||||
HSAKMT_STATUS
|
||||
HSAKMTAPI
|
||||
hsaKmtWaitOnEvent_Ext(
|
||||
HsaEvent* Event, //IN
|
||||
HSAuint32 Milliseconds, //IN
|
||||
uint64_t *event_age //IN/OUT
|
||||
);
|
||||
|
||||
/**
|
||||
Checks the current state of multiple event objects.
|
||||
|
||||
@@ -264,6 +283,30 @@ hsaKmtWaitOnMultipleEvents(
|
||||
HSAuint32 Milliseconds //IN
|
||||
);
|
||||
|
||||
/**
|
||||
Checks the current state of multiple event objects.
|
||||
event_age can help avoiding race conditions.
|
||||
|
||||
The function returns when one of the following occurs:
|
||||
- Either any one or all of the specified objects are in the signaled state
|
||||
- if "WaitOnAll" is "true" the function returns when the state of all
|
||||
objects in array is signaled
|
||||
- if "WaitOnAll" is "false" the function returns when the state of any
|
||||
one of the objects is set to signaled
|
||||
- The time-out interval elapses.
|
||||
- Tracking event age
|
||||
*/
|
||||
|
||||
HSAKMT_STATUS
|
||||
HSAKMTAPI
|
||||
hsaKmtWaitOnMultipleEvents_Ext(
|
||||
HsaEvent* Events[], //IN
|
||||
HSAuint32 NumEvents, //IN
|
||||
bool WaitOnAll, //IN
|
||||
HSAuint32 Milliseconds, //IN
|
||||
uint64_t *event_age //IN/OUT
|
||||
);
|
||||
|
||||
/**
|
||||
new TEMPORARY function definition - to be used only on "Triniti + Southern Islands" platform
|
||||
If used on other platforms the function will return HSAKMT_STATUS_ERROR
|
||||
|
||||
Criar uma nova questão referindo esta
Bloquear um utilizador