[PATCH] mutex subsystem, add typecheck_fn(type, function)