Fix thread suspend logic for pkgmgr_thread
- Issue:
If pkgmgr_client_new() is continously failed, pkgmgr_thread can sleep
very long time and this can cause deadlock when the app tries to destroy
the handle.
- Solution:
To reduce the error log, gradually increased suspend time logic was
added in pkgmgr thread. However, the suspend time could increase
without limitation and this long suspend time might cause critical
deadlock.
To solve this problem, this patch changes the suspend logic with
conditional variable. Using conditional variable, the framework will be
able to resume the thread and properly terminate it even if the suspend
time is too long. And also this patch adds a limitation for the suspend
time. So, even if the thread termination logic is failed, the thread
will be exited in a reasonable time.
Change-Id: I6e126464032a70dbf1d5f63a03c7a85c01ef0a8d
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>