<commit_before>/* $Id$ */

#ifndef _PFL_WAITQ_H_
#define _PFL_WAITQ_H_

#include <time.h>

#include "psc_util/lock.h"
#include "psc_ds/list.h"

#if HAVE_LIBPTHREAD

# include <pthread.h>

struct psc_wait_queue {
	pthread_mutex_t		wq_mut;
	pthread_cond_t		wq_cond;
};

#else /* HAVE_LIBPTHREAD */

struct psc_wait_queue {
	psc_spinlock_t		wq_mut;
	struct psclist_head	wq_sleepers;
};

#endif /* HAVE_LIBPTHREAD */

typedef struct psc_wait_queue psc_waitq_t;

void psc_waitq_init(psc_waitq_t *q);
void psc_waitq_wait(psc_waitq_t *q, psc_spinlock_t *k);
int  psc_waitq_timedwait(psc_waitq_t *q, psc_spinlock_t *k,
			 const struct timespec *abstime);
void psc_waitq_wakeup(psc_waitq_t *q);
void psc_waitq_wakeall(psc_waitq_t *q);

/* Compatibility for LNET code. */
typedef psc_waitq_t		wait_queue_head_t;
#define init_waitqueue_head(q)	psc_waitq_init(q)
#define wake_up(q)		psc_waitq_wakeup(q)

#endif /* _PFL_WAITQ_H_ */<commit_msg>clean protos<commit_after>/* $Id$ */

#ifndef _PFL_WAITQ_H_
#define _PFL_WAITQ_H_

#include <time.h>

#include "psc_util/lock.h"
#include "psc_ds/list.h"

#if HAVE_LIBPTHREAD

# include <pthread.h>

struct psc_wait_queue {
	pthread_mutex_t		wq_mut;
	pthread_cond_t		wq_cond;
};

#else /* HAVE_LIBPTHREAD */

struct psc_wait_queue {
	psc_spinlock_t		wq_mut;
	struct psclist_head	wq_sleepers;
};

#endif /* HAVE_LIBPTHREAD */

typedef struct psc_wait_queue psc_waitq_t;

void psc_waitq_init(psc_waitq_t *);
void psc_waitq_wait(psc_waitq_t *, psc_spinlock_t *);
int  psc_waitq_timedwait(psc_waitq_t *, psc_spinlock_t *, const struct timespec *);
void psc_waitq_wakeup(psc_waitq_t *);
void psc_waitq_wakeall(psc_waitq_t *);

#define psc_waitq_wakeup(q)	psc_waitq_wakeone(q)

/* Compatibility for LNET code. */
typedef psc_waitq_t		wait_queue_head_t;
#define init_waitqueue_head(q)	psc_waitq_init(q)
#define wake_up(q)		psc_waitq_wakeup(q)

#endif /* _PFL_WAITQ_H_ */
{'fraction_non_alphanumeric': 0.10618066561014262, 'fraction_numerical': 0.0, 'mean_word_length': 6.120300751879699, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '7378529', 'n_tokens_mistral': 909, 'n_tokens_neox': 908, 'n_words': 146}