Hi Tom,

On 8 May 2015 at 00:36, Tom Stellard <thomas.stell...@amd.com> wrote:
> Events can be added to an OpenCL command queue concurrently from
> multiple threads, but pipe_context and pipe_screen objects
> are not threadsafe.  The threadsafe wrappers protect all pipe_screen
> and pipe_context function calls with a mutex, so we can safely use
> them with multiple threads.
> ---
>  src/gallium/state_trackers/clover/Makefile.am      |   6 +-
>  src/gallium/state_trackers/clover/Makefile.sources |   4 +
>  src/gallium/state_trackers/clover/core/device.cpp  |   2 +
>  .../clover/core/pipe_threadsafe_context.c          | 272 
> +++++++++++++++++++++
>  .../clover/core/pipe_threadsafe_screen.c           | 184 ++++++++++++++
>  .../state_trackers/clover/core/threadsafe.h        |  39 +++
>  src/gallium/targets/opencl/Makefile.am             |   3 +-
>  7 files changed, 508 insertions(+), 2 deletions(-)
>  create mode 100644 
> src/gallium/state_trackers/clover/core/pipe_threadsafe_context.c
>  create mode 100644 
> src/gallium/state_trackers/clover/core/pipe_threadsafe_screen.c
>  create mode 100644 src/gallium/state_trackers/clover/core/threadsafe.h
>

> --- a/src/gallium/state_trackers/clover/Makefile.sources
> +++ b/src/gallium/state_trackers/clover/Makefile.sources
> @@ -53,6 +53,10 @@ CPP_SOURCES := \
>         util/range.hpp \
>         util/tuple.hpp
>
> +C_SOURCES := \
> +       core/pipe_threadsafe_context.c \
> +       core/pipe_threadsafe_screen.c
> +
Regardless of the approach (re Francisco's comment), please keep the
header (core/threadsafe.h) within the sources list.

Thanks
Emil
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to