LGTM, pushed.
> -----Original Message----- > From: Beignet [mailto:[email protected]] On Behalf Of > [email protected] > Sent: Wednesday, January 11, 2017 16:36 > To: [email protected] > Cc: He, Junyan <[email protected]> > Subject: [Beignet] [PATCH] Fix two bugs about command queue destroy. > > From: Junyan He <[email protected]> > > 1. Call finish before we destroy the command queue. > We should make sure all the commands in the queue are > finished before we really destroy the command_queue. > If not, may cause event status error. We leave the queue's > life time to user and do not ref the queue when create > event. > 2. Loose the assert condition when notify queue. > We have the case when ref of the queue is 0 but still need > to notify. > > Signed-off-by: Junyan He <[email protected]> > --- > src/cl_command_queue.c | 3 +++ > src/cl_command_queue_enqueue.c | 2 +- > 2 files changed, 4 insertions(+), 1 deletion(-) > > diff --git a/src/cl_command_queue.c b/src/cl_command_queue.c index > aa371d0..b855ff6 100644 > --- a/src/cl_command_queue.c > +++ b/src/cl_command_queue.c > @@ -81,6 +81,9 @@ cl_command_queue_delete(cl_command_queue > queue) > if (CL_OBJECT_DEC_REF(queue) > 1) > return; > > + /* Before we destroy the queue, we should make sure all > + the commands in the queue are finished. */ > + cl_command_queue_wait_finish(queue); > cl_context_remove_queue(queue->ctx, queue); > > cl_command_queue_destroy_enqueue(queue); > diff --git a/src/cl_command_queue_enqueue.c > b/src/cl_command_queue_enqueue.c index 91fabf9..44a0761 100644 > --- a/src/cl_command_queue_enqueue.c > +++ b/src/cl_command_queue_enqueue.c > @@ -122,7 +122,7 @@ cl_command_queue_notify(cl_command_queue > queue) > return; > } > > - assert(CL_OBJECT_IS_COMMAND_QUEUE(queue)); > + assert(queue && (((cl_base_object)queue)->magic == > + CL_OBJECT_COMMAND_QUEUE_MAGIC)); > CL_OBJECT_LOCK(queue); > queue->worker.cookie++; > CL_OBJECT_NOTIFY_COND(queue); > -- > 2.7.4 > > _______________________________________________ > Beignet mailing list > [email protected] > https://lists.freedesktop.org/mailman/listinfo/beignet _______________________________________________ Beignet mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/beignet
