<commit_before>
#ifndef __CONCURRENCY_PMAP_HPP__
#define __CONCURRENCY_PMAP_HPP__

#include "concurrency/cond_var.hpp"
#include "utils.hpp"
#include "errors.hpp"
#include <boost/function.hpp>

template<typename callable_t, typename value_t>
void pmap_runner_one_arg(value_t i, const callable_t *c, int *outstanding, cond_t *to_signal) {
    (*c)(i);
    (*outstanding)--;
    if (*outstanding == 0) to_signal->pulse();
}

/* If we were using C++0x, spawn_pmap_runner_one_arg() would be unnecessary because we would use decltype()
instead. */
template<typename callable_t, typename value_t>
void spawn_pmap_runner_one_arg(value_t i, const callable_t *c, int *outstanding, cond_t *to_signal) {
    coro_t::spawn_now(boost::bind(&pmap_runner_one_arg<callable_t, value_t>, i, c, outstanding, to_signal));
}<commit_msg>Stupid header include reorg.<commit_after>
#ifndef __CONCURRENCY_PMAP_HPP__
#define __CONCURRENCY_PMAP_HPP__

#include "errors.hpp"
#include <boost/bind.hpp>

#include "concurrency/cond_var.hpp"
#include "utils.hpp"

template<typename callable_t, typename value_t>
void pmap_runner_one_arg(value_t i, const callable_t *c, int *outstanding, cond_t *to_signal) {
    (*c)(i);
    (*outstanding)--;
    if (*outstanding == 0) to_signal->pulse();
}

/* If we were using C++0x, spawn_pmap_runner_one_arg() would be unnecessary because we would use decltype()
instead. */
template<typename callable_t, typename value_t>
void spawn_pmap_runner_one_arg(value_t i, const callable_t *c, int *outstanding, cond_t *to_signal) {
    coro_t::spawn_now(boost::bind(&pmap_runner_one_arg<callable_t, value_t>, i, c, outstanding, to_signal));
}
{'fraction_non_alphanumeric': 0.1225609756097561, 'fraction_numerical': 0.0024390243902439024, 'mean_word_length': 6.597222222222222, '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': '1746902', 'n_tokens_mistral': 619, 'n_tokens_neox': 603, 'n_words': 139}