Add mutex, need to complete

Signed-off-by: Ketor <d.ketor@gmail.com>