Deleted Added
full compact
29c29
< * $FreeBSD: head/lib/libthr/thread/thr_private.h 214334 2010-10-25 09:16:04Z davidxu $
---
> * $FreeBSD: head/lib/libthr/thread/thr_private.h 216641 2010-12-22 05:01:52Z davidxu $
137a138,144
> #define PMUTEX_FLAG_TYPE_MASK 0x0ff
> #define PMUTEX_FLAG_PRIVATE 0x100
> #define PMUTEX_FLAG_DEFERED 0x200
> #define PMUTEX_TYPE(mtxflags) ((mtxflags) & PMUTEX_FLAG_TYPE_MASK)
>
> #define MAX_DEFER_WAITERS 50
>
143c150
< enum pthread_mutextype m_type;
---
> int m_flags;
146d152
< int m_refcount;
149d154
< int m_private;
166,169c171,174
< struct umutex c_lock;
< struct ucond c_kerncv;
< int c_pshared;
< int c_clockid;
---
> __uint32_t __has_user_waiters;
> __uint32_t __has_kern_waiters;
> __uint32_t __flags;
> __uint32_t __clock_id;
247a253,267
> struct wake_addr {
> struct wake_addr *link;
> unsigned int value;
> char pad[12];
> };
>
> struct sleepqueue {
> TAILQ_HEAD(, pthread) sq_blocked;
> SLIST_HEAD(, sleepqueue) sq_freeq;
> LIST_ENTRY(sleepqueue) sq_hash;
> SLIST_ENTRY(sleepqueue) sq_flink;
> void *sq_wchan;
> int sq_type;
> };
>
358a379,381
> /* Sleep queue entry */
> TAILQ_ENTRY(pthread) wle;
>
484a508,528
>
> struct wake_addr *wake_addr;
> #define WAKE_ADDR(td) ((td)->wake_addr)
>
> /* Sleep queue */
> struct sleepqueue *sleepqueue;
>
> /* Wait channel */
> void *wchan;
>
> /* Referenced mutex. */
> struct pthread_mutex *mutex_obj;
>
> /* Thread will sleep. */
> int will_sleep;
>
> /* Number of threads deferred. */
> int nwaiter_defer;
>
> /* Deferred threads from pthread_cond_signal. */
> unsigned int *defer_waiters[MAX_DEFER_WAITERS];
521a566,571
> #define THR_LOCK_ACQUIRE_SPIN(thrd, lck) \
> do { \
> (thrd)->locklevel++; \
> _thr_umutex_lock_spin(lck, TID(thrd)); \
> } while (0)
>
674,675c724,728
< int _mutex_cv_lock(pthread_mutex_t *, int count) __hidden;
< int _mutex_cv_unlock(pthread_mutex_t *, int *count) __hidden;
---
> int _mutex_cv_lock(struct pthread_mutex *, int count) __hidden;
> int _mutex_cv_unlock(struct pthread_mutex *, int *count) __hidden;
> int _mutex_cv_attach(struct pthread_mutex *, int count) __hidden;
> int _mutex_cv_detach(struct pthread_mutex *, int *count) __hidden;
> int _mutex_owned(struct pthread *, const struct pthread_mutex *) __hidden;
799a853,896
> struct wake_addr *_thr_alloc_wake_addr(void);
> void _thr_release_wake_addr(struct wake_addr *);
> int _thr_sleep(struct pthread *, int, const struct timespec *);
>
> void _thr_wake_addr_init(void) __hidden;
>
> static inline void
> _thr_clear_wake(struct pthread *td)
> {
> td->wake_addr->value = 0;
> }
>
> static inline int
> _thr_is_woken(struct pthread *td)
> {
> return td->wake_addr->value != 0;
> }
>
> static inline void
> _thr_set_wake(unsigned int *waddr)
> {
> *waddr = 1;
> _thr_umtx_wake(waddr, INT_MAX, 0);
> }
>
> void _thr_wake_all(unsigned int *waddrs[], int) __hidden;
>
> static inline struct pthread *
> _sleepq_first(struct sleepqueue *sq)
> {
> return TAILQ_FIRST(&sq->sq_blocked);
> }
>
> void _sleepq_init(void) __hidden;
> struct sleepqueue *_sleepq_alloc(void) __hidden;
> void _sleepq_free(struct sleepqueue *) __hidden;
> void _sleepq_lock(void *) __hidden;
> void _sleepq_unlock(void *) __hidden;
> struct sleepqueue *_sleepq_lookup(void *) __hidden;
> void _sleepq_add(void *, struct pthread *) __hidden;
> int _sleepq_remove(struct sleepqueue *, struct pthread *) __hidden;
> void _sleepq_drop(struct sleepqueue *,
> void (*cb)(struct pthread *, void *arg), void *) __hidden;
>