<commit_before>#include "AEThread.h"
#include <iostream>
#include <algorithm>

using std::atomic;
using std::lock_guard;
using std::mutex;
using std::string;
using std::thread;
using std::chrono::duration_cast;
using std::chrono::milliseconds;

namespace AscEmu { namespace Threading
{
    atomic<unsigned int> AEThread::ThreadIdCounter(0);

    void AEThread::threadRunner()
    {
        std::cout << "[" << m_name.c_str() << "] Hello" << std::endl;

        m_done = false;

        while (!m_killed)
        {
            auto begin = std::chrono::steady_clock::now();

            m_func(*this);

            auto target = begin + m_interval;

            // We use this instead of sleep_until so we can interrupt
            while (!m_killed)
            {
                auto now = std::chrono::steady_clock::now();
                if (now > target)
                    break;

                auto distance = duration_cast<milliseconds>(target - now);

                if (m_longSleep)
                    std::this_thread::sleep_for(milliseconds(std::min(distance.count(), m_longSleepDelay)));
                else
                    std::this_thread::sleep_for(milliseconds(1));
            }
        }

        std::cout << "[" << m_name.c_str() << "] Goodbye" << std::endl;

        m_done = true;
    }

    AEThread::AEThread(string name, ThreadFunc func, milliseconds interval)
    {
        m_id = ThreadIdCounter++;
        m_name = name;
        m_func = func;
        m_killed = false;
        m_done = true;

        unsafeSetInterval(interval);
        reboot();
    }

    AEThread::~AEThread() { killThread(); }

    string AEThread::getName() const { return m_name; }<commit_msg>Attempt to fix Linux build<commit_after>#include "AEThread.h"
#include <iostream>
#include <algorithm>

using std::atomic;
using std::lock_guard;
using std::mutex;
using std::string;
using std::thread;
using std::chrono::duration_cast;
using std::chrono::milliseconds;

namespace AscEmu { namespace Threading
{
    atomic<unsigned int> AEThread::ThreadIdCounter(0);

    void AEThread::threadRunner()
    {
        std::cout << "[" << m_name.c_str() << "] Hello" << std::endl;

        m_done = false;

        while (!m_killed)
        {
            auto begin = std::chrono::steady_clock::now();

            m_func(*this);

            auto target = begin + m_interval;

            // We use this instead of sleep_until so we can interrupt
            while (!m_killed)
            {
                auto now = std::chrono::steady_clock::now();
                if (now > target)
                    break;

                auto distance = duration_cast<milliseconds>(target - now);

                if (m_longSleep)
                    std::this_thread::sleep_for(milliseconds(std::min(static_cast<long long>(distance.count()), m_longSleepDelay)));
                else
                    std::this_thread::sleep_for(milliseconds(1));
            }
        }

        std::cout << "[" << m_name.c_str() << "] Goodbye" << std::endl;

        m_done = true;
    }

    AEThread::AEThread(string name, ThreadFunc func, milliseconds interval)
    {
        m_id = ThreadIdCounter++;
        m_name = name;
        m_func = func;
        m_killed = false;
        m_done = true;

        unsafeSetInterval(interval);
        reboot();
    }

    AEThread::~AEThread() { killThread(); }

    string AEThread::getName() const { return m_name; }
{'fraction_non_alphanumeric': 0.12996808819263128, 'fraction_numerical': 0.0011604293588627793, 'mean_word_length': 2.174953959484346, 'pattern_counts': {'":': 0, '<': 44, '<?xml version=': 0, '>': 14, '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': '4649051', 'n_tokens_mistral': 1053, 'n_tokens_neox': 993, 'n_words': 215}