<commit_before>#ifndef __SPINLOCK_H__
#define __SPINLOCK_H__

typedef uint32_t spinlock_t;


static inline void 
spinlock_init (volatile spinlock_t * lock) 
{
    *lock = 0;
}


static inline void
spin_lock (volatile spinlock_t * lock)
{
    while (__sync_lock_test_and_set(lock, 1)) {
        asm volatile ("pause");
    }
}


static inline void
spin_unlock (volatile spinlock_t * lock)
{
    __sync_lock_release(lock);
}<commit_msg>add variant of spin lock without pause<commit_after>#ifndef __SPINLOCK_H__
#define __SPINLOCK_H__

typedef uint32_t spinlock_t;


static inline void 
spinlock_init (volatile spinlock_t * lock) 
{
    *lock = 0;
}


static inline void
spin_lock (volatile spinlock_t * lock)
{
    while (__sync_lock_test_and_set(lock, 1)) {
        asm volatile ("pause");
    }
}


static inline void
spin_lock_nopause (volatile spinlock_t * lock)
{
    while (__sync_lock_test_and_set(lock, 1)) {
        /* nothing */
    }
}


static inline void
spin_unlock (volatile spinlock_t * lock)
{
    __sync_lock_release(lock);
}
{'fraction_non_alphanumeric': 0.09029779058597502, 'fraction_numerical': 0.008645533141210375, 'mean_word_length': 4.033816425120773, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4848594', 'n_tokens_mistral': 397, 'n_tokens_neox': 367, 'n_words': 91}