i have couple of questions about sig_atomic_t
1. if the first declaration variable of sig_atomic_t is 0 (without assigning the 0 value, just declare like sig_atomic_t atomic; )?
2. suppose i have this code
will this become 2 seperated atomic operation that first to ++ the atomic value, and then check if the value is 1?Code:sig_atmoic_t atomic;
if( ++atomic == 1 ){
}
or it will be as one atomic operation that will guaranted that atomic variable inside if statement will not be read/write in another thread?
thanks