Liang Li <liang.z...@intel.com> wrote:
> Add the code to create and destroy the multiple threads those will
> be used to do data compression. Left some functions empty to keep
> clearness, and the code will be added later.
>
> Signed-off-by: Liang Li <liang.z...@intel.com>
> Signed-off-by: Yang Zhang <yang.z.zh...@intel.com>
> Reviewed-by: Dr.David Alan Gilbert <dgilb...@redhat.com>

/me goes back

> +struct CompressParam {
> +    /* To be done */
> +};
> +typedef struct CompressParam CompressParam;
> +
> +static CompressParam *comp_param;
> +static bool quit_comp_thread;
> +
> +static void *do_data_compress(void *opaque)
> +{
> +    while (!quit_comp_thread) {

Using this variable without any protection, read from all threads.

> +
> +    /* To be done */
> +
> +    }
> +
> +    return NULL;
> +}
> +
> +static inline void terminate_compression_threads(void)
> +{
> +    quit_comp_thread = true;

written from the main migration thread.  Shouldn't we use a mutex or at
least atomic accessors?

PD. I haven't yet finishing reading the series, in case this is fixed later.

Reply via email to