Add logic for Events in multi-thread scenario

- inc refCount when enqueue is blocked and dec after flushing

Change-Id: I9e8f8d226897124a7e51f2473939d53868bef7a2
This commit is contained in:
Stefanowski, Adam
2018-12-04 14:18:17 +01:00
committed by sys_ocldev
parent 0c2dc1b438
commit 1001f76085
4 changed files with 38 additions and 3 deletions

View File

@@ -110,11 +110,16 @@ TEST(CommandTest, givenWaitlistRequestWhenCommandComputeKernelIsCreatedThenMakeL
std::vector<Surface *> surfaces;
auto kernelOperation = new KernelOperation(std::unique_ptr<LinearStream>(cmdStream), UniqueIH(ih1), UniqueIH(ih2), UniqueIH(ih3),
*device->getDefaultEngine().commandStreamReceiver->getInternalAllocationStorage());
MockCommandComputeKernel command(cmdQ, kernelOperation, surfaces, kernel);
UserEvent event1, event2, event3;
cl_event waitlist[] = {&event1, &event2};
EventsRequest eventsRequest(2, waitlist, nullptr);
MockCommandComputeKernel command(cmdQ, kernelOperation, surfaces, kernel);
event1.incRefInternal();
event2.incRefInternal();
command.setEventsRequest(eventsRequest);
waitlist[1] = &event3;