This is an automatically generated e-mail. To reply, visit: http://reviewboard-openlmi.rhcloud.com/r/1291/

Ship it!

src/indmanager/ind_manager.c (Diff revision 1)
bool im_stop_ind(IMManager *manager, const CMPIContext *ctx, IMError *err)
1209
     * If we destroy the thread with mutex locked, the mutex is locked forever.
I'd just mention, that the mutex must not be locked by the thread we want to cancel.
Otherwise both sentences suggest that we want to have the mutex locked forever which does not make sense.

- Michal Minar


On November 26th, 2013, 11:15 a.m. UTC, Jan Safranek wrote:

Review request for OpenLMI Developers.
By Jan Safranek.

Updated Nov. 26, 2013, 11:15 a.m.

Repository: openlmi-providers

Description

indicationmgr: fixed deadlock when re-starting the namager thread.

When the indication manager thread was stopped, it destroys its mutex and
creates new one. If pthread_mutex_destroy() fails because the mutex is
locked, the new mutex is not created -> the old one is used, but it's already
locked -> deadlock.

So let's make sure the mutex is unlocked when destroying the thread.

Rewrite of indication manager thread is needed to have the manage() function
interruptible when waiting for events, e.g. using a pipe and select(),
this pthread_cancel leads to memory leaks.

Diffs

  • src/indmanager/ind_manager.c (7d6bc7545647589178ed2a858c0d136c4806b7b0)

View Diff