__syncthreads & possible deadlock situation?

I am wondering if this code might pose a possible deadlock:

__global__ void

compute(...)

{

  // do some computation for val

  if( val > threshold )

    return;

 __syncthreads();

  // do some computation with val & store it

  return;

}

So does __syncthreads() try to wait for terminated threads or did I just get lucky with my if branch never executing?

__syncthreads() does not wait for terminated threads. This code will deadlock if val is greater than threshold in some threads in a block and not others

Thanks, that’s what I was afraid of.