hooks: Alpha version of a fix for pshared mutex and condition

Signed-off-by: Christophe Chapuis <chris.chapuis@gmail.com>