protected function getFilenameForMutexKey($mutexKey)
    {
        $mutexKeyString = (is_string($mutexKey) || is_int($mutexKey)) ? (string) $mutexKey : '';
        if ($mutexKeyString === '') {
            throw new InvalidMutexKeyException($mutexKey);
        }
        if (preg_match('/^[a-zA-Z0-9_\-]{1,50}$/', $mutexKeyString)) {
            $filenameChunk = $mutexKeyString;
        } else {
            $filenameChunk = sha1($mutexKeyString);
        }

        return $this->temporaryDirectory . '/mutex-' . md5(DIR_APPLICATION) . '-' . $filenameChunk . '.lock';
    }