[Beignet] [PATCH] Fix the opencv_test_core/OCL_Arithm random segment fault.

Yang Rong rong.r.yang at intel.com
Wed Nov 19 21:59:12 PST 2014


If call cl_event_delete before call back, then event will be deleted if
application release event in the call back. So must move the cl_event_delete at the last.

Signed-off-by: Yang Rong <rong.r.yang at intel.com>
---
 src/cl_event.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/cl_event.c b/src/cl_event.c
index e20342a..dbe81ea 100644
--- a/src/cl_event.c
+++ b/src/cl_event.c
@@ -436,9 +436,6 @@ void cl_event_set_status(cl_event event, cl_int status)
     event->status = status;
   pthread_mutex_unlock(&event->ctx->event_lock);
 
-  if(event->status <= CL_COMPLETE)
-    cl_event_delete(event);
-
   /* Call user callback */
   user_cb = event->user_cb;
   while(user_cb) {
@@ -489,6 +486,8 @@ void cl_event_set_status(cl_event event, cl_int status)
     }
   }
   event->waits_head = NULL;
+  if(event->status <= CL_COMPLETE)
+    cl_event_delete(event);
 }
 
 void cl_event_update_status(cl_event event, int wait)
-- 
1.9.1



More information about the Beignet mailing list