move mutex_lock from C to Haskell
some process from C to Haskell