Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 31 Mar 2003 17:10:42 -0800 (PST)
From:      Jeff Roberson <jeff@FreeBSD.org>
To:        src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   cvs commit: src/sys/kern kern_umtx.c src/sys/sys umtx.h
Message-ID:  <200304010110.h311AgXB049113@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
jeff        2003/03/31 17:10:42 PST

  FreeBSD src repository

  Added files:
    sys/kern             kern_umtx.c 
    sys/sys              umtx.h 
  Log:
   - Add an api for doing smp safe locks in userland.
   - umtx_lock() is defined as an inline in umtx.h.  It tries to do an
     uncontested acquire of a lock which falls back to the _umtx_lock()
     system-call if that fails.
   - umtx_unlock() is also an inline which falls back to _umtx_unlock() if the
     uncontested unlock fails.
   - Locks are keyed off of the thr_id_t of the currently running thread which
     is currently just the pointer to the 'struct thread' in kernel.
   - _umtx_lock() uses the proc pointer to synchronize access to blocked thread
     queues which are stored in the first blocked thread.
  
  Revision  Changes    Path
  1.1       +303 -0    src/sys/kern/kern_umtx.c (new)
  1.1       +87 -0     src/sys/sys/umtx.h (new)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200304010110.h311AgXB049113>