FreeBSD kernel kern code
kern_condvar.c File Reference
#include <sys/cdefs.h>
#include "opt_ktrace.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/lock.h>
#include <sys/mutex.h>
#include <sys/proc.h>
#include <sys/kernel.h>
#include <sys/ktr.h>
#include <sys/condvar.h>
#include <sys/sched.h>
#include <sys/signalvar.h>
#include <sys/sleepqueue.h>
#include <sys/resourcevar.h>
Include dependency graph for kern_condvar.c:

Go to the source code of this file.

Macros

#define CV_ASSERT(cvp, lock, td)
 

Functions

 __FBSDID ("$BSDSUniX$")
 
void cv_init (struct cv *cvp, const char *desc)
 
void cv_destroy (struct cv *cvp)
 
void _cv_wait (struct cv *cvp, struct lock_object *lock)
 
void _cv_wait_unlock (struct cv *cvp, struct lock_object *lock)
 
int _cv_wait_sig (struct cv *cvp, struct lock_object *lock)
 
int _cv_timedwait (struct cv *cvp, struct lock_object *lock, int timo)
 
int _cv_timedwait_sig (struct cv *cvp, struct lock_object *lock, int timo)
 
void cv_signal (struct cv *cvp)
 
void cv_broadcastpri (struct cv *cvp, int pri)
 

Macro Definition Documentation

#define CV_ASSERT (   cvp,
  lock,
  td 
)
Value:
do { \
KASSERT((td) != NULL, ("%s: td NULL", __func__)); \
KASSERT(TD_IS_RUNNING(td), ("%s: not TDS_RUNNING", __func__)); \
KASSERT((cvp) != NULL, ("%s: cvp NULL", __func__)); \
KASSERT((lock) != NULL, ("%s: lock NULL", __func__)); \
} while (0)

Definition at line 52 of file kern_condvar.c.

Referenced by _cv_timedwait(), _cv_timedwait_sig(), _cv_wait(), _cv_wait_sig(), and _cv_wait_unlock().

Function Documentation

__FBSDID ( "$BSDSUniX$"  )
int _cv_timedwait ( struct cv *  cvp,
struct lock_object *  lock,
int  timo 
)

Definition at line 278 of file kern_condvar.c.

References CV_ASSERT, Giant, panicstr, sleepq_add(), sleepq_lock(), sleepq_release(), sleepq_set_timeout(), and sleepq_timedwait().

Here is the call graph for this function:

int _cv_timedwait_sig ( struct cv *  cvp,
struct lock_object *  lock,
int  timo 
)

Definition at line 345 of file kern_condvar.c.

References CV_ASSERT, Giant, panicstr, sleepq_add(), sleepq_lock(), sleepq_release(), sleepq_set_timeout(), and sleepq_timedwait_sig().

Here is the call graph for this function:

void _cv_wait ( struct cv *  cvp,
struct lock_object *  lock 
)

Definition at line 95 of file kern_condvar.c.

References CV_ASSERT, Giant, panicstr, sleepq_add(), sleepq_lock(), sleepq_release(), and sleepq_wait().

Here is the call graph for this function:

int _cv_wait_sig ( struct cv *  cvp,
struct lock_object *  lock 
)

Definition at line 212 of file kern_condvar.c.

References CV_ASSERT, Giant, panicstr, sleepq_add(), sleepq_lock(), sleepq_release(), and sleepq_wait_sig().

Here is the call graph for this function:

void _cv_wait_unlock ( struct cv *  cvp,
struct lock_object *  lock 
)

Definition at line 157 of file kern_condvar.c.

References CV_ASSERT, Giant, panicstr, sleepq_add(), sleepq_lock(), sleepq_release(), and sleepq_wait().

Here is the call graph for this function:

void cv_broadcastpri ( struct cv *  cvp,
int  pri 
)

Definition at line 434 of file kern_condvar.c.

References sleepq_broadcast(), sleepq_lock(), and sleepq_release().

Referenced by doselwakeup(), and logtimeout().

Here is the call graph for this function:

Here is the caller graph for this function:

void cv_destroy ( struct cv *  cvp)

Definition at line 75 of file kern_condvar.c.

References sleepq_lock(), sleepq_lookup(), and sleepq_release().

Referenced by kern_sendfile(), ksem_drop(), sema_destroy(), and tty_dealloc().

Here is the call graph for this function:

Here is the caller graph for this function:

void cv_init ( struct cv *  cvp,
const char *  desc 
)

Definition at line 63 of file kern_condvar.c.

Referenced by devinit(), kern_sendfile(), ksem_alloc(), log_drvinit(), proc_init(), pts_alloc(), pts_alloc_external(), seltdinit(), sema_init(), tty_alloc_mutex(), and vntblinit().

Here is the caller graph for this function:

void cv_signal ( struct cv *  cvp)

Definition at line 414 of file kern_condvar.c.

References sleepq_lock(), sleepq_release(), and sleepq_signal().

Referenced by _sema_post(), sf_buf_mext(), sys_ksem_post(), and ttydev_write().

Here is the call graph for this function:

Here is the caller graph for this function: