aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/lock.h
diff options
context:
space:
mode:
authorDavide Italiano <davide@FreeBSD.org>2013-09-20 23:06:21 +0000
committerDavide Italiano <davide@FreeBSD.org>2013-09-20 23:06:21 +0000
commit7faf4d90e884a567477da91241f1c2b76f148272 (patch)
tree0f8acc1728a85e0911253a1fa7cfe9c10d2c05b4 /sys/sys/lock.h
parent566a5f502062abb65b03ae1410a792d69b23dd46 (diff)
downloadsrc-7faf4d90e884a567477da91241f1c2b76f148272.tar.gz
src-7faf4d90e884a567477da91241f1c2b76f148272.zip
Fix lc_lock/lc_unlock() support for rmlocks held in shared mode. With
current lock classes KPI it was really difficult because there was no way to pass an rmtracker object to the lock/unlock routines. In order to accomplish the task, modify the aforementioned functions so that they can return (or pass as argument) an uinptr_t, which is in the rm case used to hold a pointer to struct rm_priotracker for current thread. As an added bonus, this fixes rm_sleep() in the rm shared case, which right now can communicate priotracker structure between lc_unlock()/lc_lock(). Suggested by: jhb Reviewed by: jhb Approved by: re (delphij)
Notes
Notes: svn path=/head/; revision=255745
Diffstat (limited to 'sys/sys/lock.h')
-rw-r--r--sys/sys/lock.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/sys/sys/lock.h b/sys/sys/lock.h
index 40dc16bc5cbb..58343b594837 100644
--- a/sys/sys/lock.h
+++ b/sys/sys/lock.h
@@ -56,13 +56,14 @@ struct thread;
*/
struct lock_class {
- const char *lc_name;
- u_int lc_flags;
- void (*lc_assert)(const struct lock_object *lock, int what);
- void (*lc_ddb_show)(const struct lock_object *lock);
- void (*lc_lock)(struct lock_object *lock, int how);
- int (*lc_owner)(const struct lock_object *lock, struct thread **owner);
- int (*lc_unlock)(struct lock_object *lock);
+ const char *lc_name;
+ u_int lc_flags;
+ void (*lc_assert)(const struct lock_object *lock, int what);
+ void (*lc_ddb_show)(const struct lock_object *lock);
+ void (*lc_lock)(struct lock_object *lock, uintptr_t how);
+ int (*lc_owner)(const struct lock_object *lock,
+ struct thread **owner);
+ uintptr_t (*lc_unlock)(struct lock_object *lock);
};
#define LC_SLEEPLOCK 0x00000001 /* Sleep lock. */