Closed Nik4053 closed 4 years ago
Indeed, there is a bug that may cause deadlock. Following patch fixes it. https://github.com/smartnode/telebot/commit/e4adb7189d57dc88d1f7aaba28d957122555eff0
I am new to this kind of thing but why can we use just a normal variable as a lock? I thought a mutex or an atomic operation has to be used in such cases.
I was using simpler alternative to mutex, and remove necessity for locking, and/or busy waiting.
The method sets core_h->busy = true, but never sets it back to false on error. -> Next time program will halt indefinitely.