Changeset View
Changeset View
Standalone View
Standalone View
sys/sys/_rmlock.h
| Show All 26 Lines | |||||
| * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||||
| * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||||
| * SUCH DAMAGE. | * SUCH DAMAGE. | ||||
| */ | */ | ||||
| #ifndef _SYS__RMLOCK_H_ | #ifndef _SYS__RMLOCK_H_ | ||||
| #define _SYS__RMLOCK_H_ | #define _SYS__RMLOCK_H_ | ||||
| #include <sys/_cpuset.h> | |||||
| #include <sys/_lock.h> | |||||
| #include <sys/_mutex.h> | |||||
| #include <sys/queue.h> | |||||
| #include <sys/_sx.h> | |||||
| struct thread; | |||||
| /* | /* | ||||
| * Mostly reader/occasional writer lock. | * Mostly reader/occasional writer lock. | ||||
| */ | */ | ||||
| LIST_HEAD(rmpriolist,rm_priotracker); | LIST_HEAD(rmpriolist,rm_priotracker); | ||||
| struct rm_queue { | struct rm_queue { | ||||
| struct rm_queue *volatile rmq_next; | struct rm_queue *volatile rmq_next; | ||||
| Show All 17 Lines | |||||
| struct rm_priotracker { | struct rm_priotracker { | ||||
| struct rm_queue rmp_cpuQueue; /* Must be first */ | struct rm_queue rmp_cpuQueue; /* Must be first */ | ||||
| struct rmlock *rmp_rmlock; | struct rmlock *rmp_rmlock; | ||||
| struct thread *rmp_thread; | struct thread *rmp_thread; | ||||
| int rmp_flags; | int rmp_flags; | ||||
| LIST_ENTRY(rm_priotracker) rmp_qentry; | LIST_ENTRY(rm_priotracker) rmp_qentry; | ||||
| }; | }; | ||||
| #include <sys/_mutex.h> | |||||
| struct rmslock_pcpu; | struct rmslock_pcpu; | ||||
| struct rmslock { | struct rmslock { | ||||
| struct mtx mtx; | struct mtx mtx; | ||||
| struct thread *owner; | struct thread *owner; | ||||
| struct rmslock_pcpu *pcpu; | struct rmslock_pcpu *pcpu; | ||||
| int writers; | int writers; | ||||
| int readers; | int readers; | ||||
| int debug_readers; | int debug_readers; | ||||
| }; | }; | ||||
| #endif /* !_SYS__RMLOCK_H_ */ | #endif /* !_SYS__RMLOCK_H_ */ | ||||