Closed ashione closed 1 year ago
Thanks for your contribution! I'm still trying to visualize the deadlock in my head. I don't completely understand how this gets locked but well I guess it makes some sense.
Thanks for your contribution! I'm still trying to visualize the deadlock in my head. I don't completely understand how this gets locked but well I guess it makes some sense.
The key reason is that destructor holds init_lock mutex so that mThread can not join and wait the worker-thread finish.
Oh, you're right, thanks for the clarification.
There is deadlock between main thread executing destructor and hand action thread. So this PR try create a new bool member property to mark hand action thread working or not. Besides, file watcher destructor will wait until action thread finished, which gurantees backgroud thread could be terminated successfully.