<commit_before>#ifndef MIMOSA_SYNC_SPINLOCK_HH
# define MIMOSA_SYNC_SPINLOCK_HH

# include <pthread.h>

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

namespace mimosa
{
  namespace sync
  {
    class SpinLock : private NonCopyable
    {
    public:
      typedef Locker<SpinLock> Locker;
      typedef UniqueLocker<SpinLock> UniqueLocker;
      inline SpinLock() { ::pthread_spin_init(&spinlock_, PTHREAD_PROCESS_PRIVATE); }
      inline ~SpinLock() { ::pthread_spin_destroy(spinlock_); }
      inline void lock() { ::pthread_spin_lock(&spinlock_); }
      inline void unlock() { ::pthread_spin_unlock(&spinlock_); }
    private:
      ::pthread_spinlock_t spinlock_;
    };
  }
}

#endif /* !MIMOSA_SYNC_SPINLOCK_HH */
<commit_msg>Fixed spin lock<commit_after>#ifndef MIMOSA_SYNC_SPINLOCK_HH
# define MIMOSA_SYNC_SPINLOCK_HH

# include <pthread.h>

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

namespace mimosa
{
  namespace sync
  {
    class SpinLock : private NonCopyable
    {
    public:
      typedef sync::Locker<SpinLock> Locker;
      typedef sync::UniqueLocker<SpinLock> UniqueLocker;

      inline SpinLock() { ::pthread_spin_init(&spinlock_, PTHREAD_PROCESS_PRIVATE); }
      inline ~SpinLock() { ::pthread_spin_destroy(&spinlock_); }
      inline void lock() { ::pthread_spin_lock(&spinlock_); }
      inline void unlock() { ::pthread_spin_unlock(&spinlock_); }

    private:
      ::pthread_spinlock_t spinlock_;
    };
  }
}

#endif /* !MIMOSA_SYNC_SPINLOCK_HH */

{'fraction_non_alphanumeric': 0.12057667103538663, 'fraction_numerical': 0.0, 'mean_word_length': 4.0230263157894735, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '4500632', 'n_tokens_mistral': 545, 'n_tokens_neox': 535, 'n_words': 94}