<commit_before>#pragma once

#include <mutex>
#include <condition_variable>

namespace cpl
{
class Semaphore {
public:
    Semaphore(int n)
    : _n(n)
    {
    }

    inline
    void acquire()
    {
        std::unique_lock<std::mutex> _(_m);
        _cv.wait(_, [this]() { return _n > 0; });
        _n--;
    }

    inline
    void release()
    {
        std::unique_lock<std::mutex> _(_m);
        _n++;
        _cv.notify_one();
    }

    // Disable copying.
    Semaphore(const Semaphore&) = delete;
    Semaphore& operator =(const Semaphore&) = delete;

private:
    int _n;
    std::mutex _m;
    std::condition_variable _cv;
<commit_msg>who put these spaces here<commit_after>#pragma once

#include <mutex>
#include <condition_variable>

namespace cpl
{
class Semaphore {
public:
	Semaphore(int n)
	: _n(n)
	{
	}

	inline
	void acquire()
	{
		std::unique_lock<std::mutex> _(_m);
		_cv.wait(_, [this]() { return _n > 0; });
		_n--;
	}

	inline
	void release()
	{
		std::unique_lock<std::mutex> _(_m);
		_n++;
		_cv.notify_one();
	}

	// Disable copying.
	Semaphore(const Semaphore&) = delete;
	Semaphore& operator =(const Semaphore&) = delete;

private:
	int _n;
	std::mutex _m;
	std::condition_variable _cv;

{'fraction_non_alphanumeric': 0.15081967213114755, 'fraction_numerical': 0.001639344262295082, 'mean_word_length': 2.9514563106796117, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 13, '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': '5123440', 'n_tokens_mistral': 487, 'n_tokens_neox': 470, 'n_words': 102}