Take the compiledir lock only if the op generate c code.