extracting task operating functions in mutex struct