git: kernel/lockmgr: Add lockmgr_try().

Sascha Wildner swildner at crater.dragonflybsd.org
Sat Jul 21 01:31:05 PDT 2018


commit a9ea406521403b6b39c4d2c3813488a5d29f77fe
Author: Sascha Wildner <saw at online.de>
Date:   Sat Jul 21 10:28:17 2018 +0200

    kernel/lockmgr: Add lockmgr_try().
    
    It just adds LK_NOWAIT to the flags and returns whether the
    lock was obtained.
    
    It is similar to other functions such as spin_trylock() or
    FreeBSD's mtx_trylock() and can be used to port the latter.
    
    Note that like these functions, it returns TRUE if successful,
    while lockmgr() returns 0 if successful. This difference was
    the source of minor confusion and porting mistakes in the past.
    In fact, our driver porting document also didn't point out this
    difference. I will fix some of these little issues in a separate
    commit.

Summary of changes:
 doc/porting_drivers.txt |  2 +-
 share/man/man9/Makefile |  1 +
 share/man/man9/lock.9   | 15 ++++++++++++++-
 sys/sys/lock.h          | 11 +++++++++++
 4 files changed, 27 insertions(+), 2 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/a9ea406521403b6b39c4d2c3813488a5d29f77fe


-- 
DragonFly BSD source repository



More information about the Commits mailing list