<commit_before>
#ifndef ISC_RWLOCK_H
#define ISC_RWLOCK_H 1

#include <isc/result.h>
#include <isc/mutex.h>
#include <isc/condition.h>

typedef enum {
	isc_rwlocktype_read = 0,
	isc_rwlocktype_write
} isc_rwlocktype_t;

typedef struct isc_rwlock {
	isc_mutex_t		lock;
	isc_condition_t		readable;
	isc_condition_t		writeable;
	isc_rwlocktype_t	type;
	unsigned int		active;
	unsigned int		granted;
	unsigned int		readers_waiting;
	unsigned int		writers_waiting;
	unsigned int		read_quota;
	unsigned int		write_quota;
} isc_rwlock_t;

isc_result_t
isc_rwlock_init(isc_rwlock_t *rwl, unsigned int read_quota,
		unsigned int write_quota);

isc_result_t
isc_rwlock_lock(isc_rwlock_t *rwl, isc_rwlocktype_t type);

isc_result_t
isc_rwlock_unlock(isc_rwlock_t *rwl, isc_rwlocktype_t type);

void
isc_rwlock_destroy(isc_rwlock_t *rwl);

#endif /* ISC_RWLOCK_H */
<commit_msg>add magic<commit_after>
#ifndef ISC_RWLOCK_H
#define ISC_RWLOCK_H 1

#include <isc/result.h>
#include <isc/mutex.h>
#include <isc/condition.h>

typedef enum {
	isc_rwlocktype_read = 0,
	isc_rwlocktype_write
} isc_rwlocktype_t;

typedef struct isc_rwlock {
	unsigned int		magic;
	isc_mutex_t		lock;
	isc_condition_t		readable;
	isc_condition_t		writeable;
	isc_rwlocktype_t	type;
	unsigned int		active;
	unsigned int		granted;
	unsigned int		readers_waiting;
	unsigned int		writers_waiting;
	unsigned int		read_quota;
	unsigned int		write_quota;
} isc_rwlock_t;

isc_result_t
isc_rwlock_init(isc_rwlock_t *rwl, unsigned int read_quota,
		unsigned int write_quota);

isc_result_t
isc_rwlock_lock(isc_rwlock_t *rwl, isc_rwlocktype_t type);

isc_result_t
isc_rwlock_unlock(isc_rwlock_t *rwl, isc_rwlocktype_t type);

void
isc_rwlock_destroy(isc_rwlock_t *rwl);

#endif /* ISC_RWLOCK_H */

{'fraction_non_alphanumeric': 0.07257142857142856, 'fraction_numerical': 0.002285714285714286, 'mean_word_length': 6.205761316872428, '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': '4598330', 'n_tokens_mistral': 771, 'n_tokens_neox': 757, 'n_words': 148}