It\'s written in POSIX threads tutorial https://computing.llnl.gov/tutorials/pthreads/ that it is a logical error.
my question is why it is a logical error?
I write my answer because I do not see the one that will calm people. I also stumbled upon that bizarre disturbing warning about “logical error” in that tutorial. Note that there is nothing about this “error” in the POSIX documentation article on pthread_cond_signal. I am sure that this is an unfortunate choice of the term or a plain mistake on part of the author of the tutorial. Their claim may be interpreted as if a process will terminate with an error in this situation or that any program permitting this situation is incorrect. Nothing of the sort is true. Such situations are common. The documentation says that
The
pthread_cond_signal()andpthread_cond_broadcast()functions have no effect if there are no threads currently blocked oncond.
So don't worry and be happy.