@@ -406,7 +406,11 @@ ze_result_t ZeCall::doCall(ze_result_t ZeResult, const char *CallStr,
406
406
return mapError(Result);
407
407
#define ZE_CALL_NOCHECK (Call ) ZeCall().doCall(Call, #Call, false )
408
408
409
- inline void piQueueRetainNoLock (pi_queue Queue) { Queue->RefCount ++; }
409
+ // This helper function increments the reference counter of the Queue
410
+ // without guarding with a lock.
411
+ // It is the caller's responsibility to make sure the lock is acquired
412
+ // on the Queue that is passed in.
413
+ inline static void piQueueRetainNoLock (pi_queue Queue) { Queue->RefCount ++; }
410
414
411
415
// This helper function creates a pi_event and associate a pi_queue.
412
416
// Note that the caller of this function must have acquired lock on the Queue
@@ -416,7 +420,7 @@ inline void piQueueRetainNoLock(pi_queue Queue) { Queue->RefCount++; }
416
420
// \param CommandType various command type determined by the caller
417
421
// \param ZeCommandList the handle to associate with the newly created event
418
422
// \param ZeEvent the ZeEvent handle to be associated with the event
419
- inline pi_result createEventAndAssociateQueue (
423
+ inline static pi_result createEventAndAssociateQueue (
420
424
pi_queue Queue, pi_event *Event, pi_command_type CommandType,
421
425
ze_command_list_handle_t ZeCommandList, ze_event_handle_t *ZeEvent) {
422
426
pi_result Res = piEventCreate (Queue->Context , Event);
@@ -429,9 +433,10 @@ inline pi_result createEventAndAssociateQueue(
429
433
430
434
*ZeEvent = (*Event)->ZeEvent ;
431
435
// We need to increment the reference counter here to avoid pi_queue
432
- // being release before the associated pi_event is released because
436
+ // being released before the associated pi_event is released because
433
437
// piEventRelease requires access to the associated pi_queue.
434
- // In piEventRelease, the reference counter is decremented to release it.
438
+ // In piEventRelease, the reference counter of the Queue is decremented
439
+ // to release it.
435
440
piQueueRetainNoLock (Queue);
436
441
return PI_SUCCESS;
437
442
}
0 commit comments