The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/sys/condvar.h

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 #ifndef _SYS_CONDVAR_H_
    2 #define _SYS_CONDVAR_H_
    3 
    4 #include <sys/spinlock.h>
    5 
    6 struct lock;
    7 
    8 struct cv {
    9         struct spinlock cv_lock;
   10         int             cv_waiters;
   11         const char      *cv_desc;
   12 };
   13 
   14 void    cv_init(struct cv *, const char *desc);
   15 void    cv_destroy(struct cv *);
   16 
   17 int     _cv_timedwait(struct cv *, struct lock *, int timo, int wakesig);
   18 void    _cv_signal(struct cv *, int broadcast);
   19 
   20 int     cv_has_waiters(const struct cv *);
   21 
   22 #define cv_wait(cv, lock)                       \
   23                 _cv_timedwait((cv), (lock), 0, 0)
   24 #define cv_wait_sig(cv, lock)                   \
   25                 _cv_timedwait((cv), (lock), 0, 1)
   26 #define cv_timedwait(cv, lock, timeo)           \
   27                 _cv_timedwait((cv), (lock), (timeo), 0)
   28 #define cv_timedwait_sig(cv, lock, timeo)       \
   29                 _cv_timedwait((cv), (lock), (timeo), 1)
   30 
   31 #define cv_signal(cv)                           \
   32                 _cv_signal((cv), 0)
   33 #define cv_broadcast(cv)                        \
   34                 _cv_signal((cv), 1)
   35 #define cv_broadcastpri(cv, pri)                \
   36                 cv_broadcast((cv))
   37 
   38 #endif  /* _SYS_CONDVAR_H_ */

Cache object: cba57a268077db96ed87f712e4ae111f


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.