<commit_before>/*
 * Copyright (C) 2013 by <NAME> (<EMAIL>)
 *
 * Released under the MIT license, see LICENSE.txt
 */

#include <deque>
#include <cassert>
#include <map>
#include <sstream>
#include <cmath>
#include <limits>
#include <algorithm>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "hal.h"
#include "halChain.h"
#include "halBlockViz.h"
#include "halBlockMapper.h"
#include "halLodManager.h"
#include "halMafExport.h"

#ifdef ENABLE_UDC
#include <pthread.h>
static pthread_mutex_t HAL_MUTEX;
static inline void halLock() {
    pthread_mutex_lock(&HAL_MUTEX);
}
static inline void halUnlock() {
    pthread_mutex_unlock(&HAL_MUTEX);
}
#else<commit_msg>added error checking and initialize to blockviztest locking<commit_after>/*
 * Copyright (C) 2013 by <NAME> (<EMAIL>)
 *
 * Released under the MIT license, see LICENSE.txt
 */

#include <deque>
#include <cassert>
#include <map>
#include <sstream>
#include <cmath>
#include <cmath>
#include <cerrno>
#include <cstring>
#include <limits>
#include <algorithm>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "hal.h"
#include "halChain.h"
#include "halBlockViz.h"
#include "halBlockMapper.h"
#include "halLodManager.h"
#include "halMafExport.h"

#ifdef ENABLE_UDC
#include <pthread.h>
static pthread_mutex_t HAL_MUTEX = PTHREAD_MUTEX_INITIALIZER;
static inline void halLock() {
    if (pthread_mutex_lock(&HAL_MUTEX) != 0) {
        throw hal_exception("pthread_mutex_lock failed: " + std::string(std::strerror(errno)));
    }
}
static inline void halUnlock() {
    if (pthread_mutex_unlock(&HAL_MUTEX) != 0) {
        throw hal_exception("pthread_mutex_unlock failed: " + std::string(std::strerror(errno)));
    }
}
#else
{'fraction_non_alphanumeric': 0.14534883720930233, 'fraction_numerical': 0.005813953488372093, 'mean_word_length': 5.670542635658915, 'pattern_counts': {'":': 0, '<': 32, '<?xml version=': 0, '>': 32, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1848495', 'n_tokens_mistral': 649, 'n_tokens_neox': 633, 'n_words': 153}