Any hang demo when a __syncthreads() used in conditional code?

According to CUDA C++ Programming Guide 7.6

“”“__syncthreads() is allowed in conditional code but only if the conditional evaluates identically across the entire thread block, otherwise the code execution is likely to hang or produce unintended side effects.”“”

I don’t understand what’s the exactly code for the conditional evaluates not identically.
i.e. What code will generate the hang or produce unintended side effects situation when using __syncthreads()?

This condition does not evaluate identically for all threads in the thread block.

if(threadIdx.x == 0){
    
}

I tried this, but it seems ok.

`if(threadIdx.x == 0){

}`

The documentation only guarantees that it will work correctly when it is called by all threads in the block.
For all other cases, it is undefined behavior, which effectively means anything can happen. This includes “it works”.