Fix the multi-thread crash problem of batch buffer release.
authorJunyan He <junyan.he@linux.intel.com>
Mon, 6 Jan 2014 09:06:59 +0000 (17:06 +0800)
committerZhigang Gong <zhigang.gong@intel.com>
Tue, 7 Jan 2014 08:39:13 +0000 (16:39 +0800)
commit075816046c7147bc4277add300b54857a9af04fb
tree0026a82448beca42322541407e2e5d581f7c8100
parent3f44e60a6a7b18c9b8ba171391f2273b090c5303
Fix the multi-thread crash problem of batch buffer release.

The case causes like this:
our thread hold the ref of the batch buffer, but have called
cl_driver_delete to delete the bufmgr. So when we release
the buffer object next time, the bufmgr's function pointer
is invalid and cause the crash.
We now release the batch buffer before every time call the
cl_set_thread_batch_buf.

Signed-off-by: Junyan He <junyan.he@linux.intel.com>
Tested-by: "Yang, Rong R" <rong.r.yang@intel.com>
src/cl_context.c
src/cl_device_id.c