<commit_before>#ifndef MIMOSA_SYNC_CONDITION_HH
# define MIMOSA_SYNC_CONDITION_HH

# include <stdexcept>

# include <melon/melon.h>

# include "../non-copyable.hh"

namespace mimosa
{
  namespace sync
  {
    class Condition : private NonCopyable
    {
    public:
      inline Condition()
        : cond_(::melon_cond_new())
      {
        if (!cond_)
          throw std::bad_alloc();
      }

      inline ~Condition() { ::melon_cond_destroy(cond_); }

      template <typename Mutex>
      inline void wait(Mutex & mutex) { ::melon_cond_wait(cond_, mutex.mutex_); }

      template <typename Mutex>
      inline void timedWait(Mutex & mutex, ::melon_time_t time)
      { ::melon_cond_timedwait(cond_, mutex.mutex_, time); }<commit_msg>Simplifying sync::Condition<commit_after>#ifndef MIMOSA_SYNC_CONDITION_HH
# define MIMOSA_SYNC_CONDITION_HH

# include <stdexcept>

# include <melon/melon.h>

# include "../non-copyable.hh"
# include "../runtime/time.hh"

namespace mimosa
{
  namespace sync
  {
    class Condition : private NonCopyable
    {
    public:
      inline Condition()
        : cond_(::melon_cond_new())
      {
        if (!cond_)
          throw std::bad_alloc();
      }

      inline ~Condition() { ::melon_cond_destroy(cond_); }

      template <typename Mutex>
      inline void wait(Mutex & mutex, runtime::Time time = 0)
      { ::melon_cond_timedwait(cond_, mutex.mutex_, time); }
{'fraction_non_alphanumeric': 0.12144886363636363, 'fraction_numerical': 0.0007102272727272727, 'mean_word_length': 3.0722543352601157, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 10, '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': '6167033', 'n_tokens_mistral': 472, 'n_tokens_neox': 471, 'n_words': 95}