1 /* bsd_mutex.h: BSD Mutex helper
3 Copyright 2003, 2005 Red Hat, Inc.
5 This file is part of Cygwin.
7 This software is a copyrighted work licensed under the terms of the
8 Cygwin license. Please consult the file "CYGWIN_LICENSE" for
19 #define PRIO_MASK (0x1f)
31 /* Some BSD kernel global mutex. */
32 extern struct mtx Giant;
34 void mtx_init (mtx *, const char *, const void *, int);
35 void _mtx_lock (mtx *, DWORD winpid, const char *, int);
36 #define mtx_lock(m) _mtx_lock((m), (td->ipcblk->winpid), __FILE__, __LINE__)
37 int mtx_owned (mtx *, DWORD);
38 void _mtx_assert(mtx *, int, DWORD winpid, const char *, int);
39 #define mtx_assert(m,w,p) _mtx_assert((m),(w),(p),__FILE__,__LINE__)
40 void _mtx_unlock (mtx *, const char *, int);
41 #define mtx_unlock(m) _mtx_unlock((m),__FILE__,__LINE__)
43 void mtx_destroy (mtx *);
45 void msleep_init (void);
46 int _msleep (void *, struct mtx *, int, const char *, int, struct thread *);
47 #define msleep(i,m,p,w,t) _msleep((i),(m),(p),(w),(t),(td))
48 #define tsleep(i,p,w,t) _msleep((i),NULL,(p),(w),(t),(td))
50 void wakeup_all (void);
52 #endif /* _BSD_MUTEX_H */