History log of /freebsd/lib/libthr/thread/thr_mutex.c (Results 51 – 75 of 208)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# b652778e 11-Jul-2012 Peter Grehan <grehan@FreeBSD.org>

IFC @ r238370


# 2d5e7d2e 30-May-2012 Will Andrews <will@FreeBSD.org>

IFC @ r236291.
Diff reductions to the enclosure driver made in r235911.


# 31ccd489 28-May-2012 Gleb Smirnoff <glebius@FreeBSD.org>

Merge head r233826 through r236168.


# e3b090f0 27-May-2012 David Xu <davidxu@FreeBSD.org>

Return EBUSY for PTHREAD_MUTEX_ADAPTIVE_NP too when the mutex could not
be acquired.

PR: 168317
MFC after: 3 days


Revision tags: release/8.3.0_cvs, release/8.3.0, release/9.0.0, release/7.4.0_cvs, release/8.2.0_cvs, release/7.4.0, release/8.2.0
# ebc8e8fd 06-Jan-2011 David Xu <davidxu@FreeBSD.org>

Return 0 instead of garbage value.

Found by: clang static analyzer


# e29ba4c2 24-Dec-2010 David Xu <davidxu@FreeBSD.org>

Always clear flag PMUTEX_FLAG_DEFERED when unlocking, as it is only
significant for lock owner.


# d1078b0b 22-Dec-2010 David Xu <davidxu@FreeBSD.org>

MFp4:

- Add flags CVWAIT_ABSTIME and CVWAIT_CLOCKID for umtx kernel based
condition variable, this should eliminate an extra system call to get
current time.

- Add sub-function UMTX_OP_NWAKE_PR

MFp4:

- Add flags CVWAIT_ABSTIME and CVWAIT_CLOCKID for umtx kernel based
condition variable, this should eliminate an extra system call to get
current time.

- Add sub-function UMTX_OP_NWAKE_PRIVATE to wake up N channels in single
system call. Create userland sleep queue for condition variable, in most
cases, thread will wait in the queue, the pthread_cond_signal will defer
thread wakeup until the mutex is unlocked, it tries to avoid an extra
system call and a extra context switch in time window of pthread_cond_signal
and pthread_mutex_unlock.

The changes are part of process-shared mutex project.

show more ...


# b9f2f8c3 01-Nov-2010 Dimitry Andric <dim@FreeBSD.org>

Sync: merge r214353 through r214648 from ^/head.


# e96b4de8 27-Oct-2010 David Xu <davidxu@FreeBSD.org>

Remove locking and unlock in pthread_mutex_destroy, because
it can not fix race condition in application code, as a result,
the problem described in PR threads/151767 is avoided.


# ec92603c 29-Sep-2010 David Xu <davidxu@FreeBSD.org>

Check invalid mutex in _mutex_cv_unlock.


# bbb64c21 28-Sep-2010 David Xu <davidxu@FreeBSD.org>

In current code, statically initialized and destroyed object have
same null value, the code can not distinguish between them, to
fix the problem, now a destroyed object is assigned to a non-null
valu

In current code, statically initialized and destroyed object have
same null value, the code can not distinguish between them, to
fix the problem, now a destroyed object is assigned to a non-null
value, and it will be rejected by some pthread functions.
PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP is changed to number 1, so that
adaptive mutex can be statically initialized correctly.

show more ...


# ada33a6e 01-Sep-2010 David Xu <davidxu@FreeBSD.org>

Change atfork lock from mutex to rwlock, also make mutexes used by malloc()
module private type, when private type mutex is locked/unlocked, thread
critical region is entered or leaved. These changes

Change atfork lock from mutex to rwlock, also make mutexes used by malloc()
module private type, when private type mutex is locked/unlocked, thread
critical region is entered or leaved. These changes makes fork()
async-signal safe which required by POSIX. Note that user's atfork handler
still needs to be async-signal safe, but it is not problem of libthr, it
is user's responsiblity.

show more ...


Revision tags: release/8.1.0_cvs, release/8.1.0, release/7.3.0_cvs, release/7.3.0, release/8.0.0_cvs, release/8.0.0, release/7.2.0_cvs, release/7.2.0, release/7.1.0_cvs, release/7.1.0, release/6.4.0_cvs, release/6.4.0
# 7de1ecef 24-Jun-2008 David Xu <davidxu@FreeBSD.org>

Add two commands to _umtx_op system call to allow a simple mutex to be
locked and unlocked completely in userland. by locking and unlocking mutex
in userland, it reduces the total time a mutex is loc

Add two commands to _umtx_op system call to allow a simple mutex to be
locked and unlocked completely in userland. by locking and unlocking mutex
in userland, it reduces the total time a mutex is locked by a thread,
in some application code, a mutex only protects a small piece of code, the
code's execution time is less than a simple system call, if a lock contention
happens, however in current implemenation, the lock holder has to extend its
locking time and enter kernel to unlock it, the change avoids this disadvantage,
it first sets mutex to free state and then enters kernel and wake one waiter
up. This improves performance dramatically in some sysbench mutex tests.

Tested by: kris
Sounds great: jeff

show more ...


# 850f4d66 29-May-2008 David Xu <davidxu@FreeBSD.org>

- Reduce function call overhead for uncontended case.
- Remove unused flags MUTEX_FLAGS_* and their code.
- Check validity of the timeout parameter in mutex_self_lock().


# dd77f9f7 26-Apr-2008 Kris Kennaway <kris@FreeBSD.org>

Increase the default MUTEX_ADAPTIVE_SPINS to 2000, after further
testing it turns out 200 was too short to give good adaptive
performance.

Reviewed by: jeff
MFC after: 1 week


# 7e0e7824 25-Mar-2008 Ruslan Ermilov <ru@FreeBSD.org>

Fixed mis-implementation of pthread_mutex_get{spin,yield}loops_np().

Reviewed by: davidxu


Revision tags: release/7.0.0_cvs, release/7.0.0
# 096ba447 14-Feb-2008 Dag-Erling Smørgrav <des@FreeBSD.org>

_pthread_mutex_isowned_np(): use a more reliable method; the current code
will work in simple cases, but may fail in more complicated ones.

Reviewed by: davidxu


# d29b081f 06-Feb-2008 Dag-Erling Smørgrav <des@FreeBSD.org>

Remove unnecessary prototype.


# 1cbdac26 06-Feb-2008 Dag-Erling Smørgrav <des@FreeBSD.org>

Per discussion on -threads, rename _islocked_np() to _isowned_np().


# fcd61d91 04-Feb-2008 Dag-Erling Smørgrav <des@FreeBSD.org>

After careful consideration (and a brief discussion with attilio@), change
the semantics of pthread_mutex_islocked_np() to return true if and only if
the mutex is held by the current thread.

Obvious

After careful consideration (and a brief discussion with attilio@), change
the semantics of pthread_mutex_islocked_np() to return true if and only if
the mutex is held by the current thread.

Obviously, change the regression test to match.

MFC after: 2 weeks

show more ...


# 5fd410a7 03-Feb-2008 Dag-Erling Smørgrav <des@FreeBSD.org>

Add pthread_mutex_islocked_np(), a cheap way to verify that a mutex is
locked. This is intended primarily to support the userland equivalent
of the various *_ASSERT_LOCKED() macros we have in the ke

Add pthread_mutex_islocked_np(), a cheap way to verify that a mutex is
locked. This is intended primarily to support the userland equivalent
of the various *_ASSERT_LOCKED() macros we have in the kernel.

MFC after: 2 weeks

show more ...


Revision tags: release/6.3.0_cvs, release/6.3.0
# c5f41151 17-Dec-2007 David Xu <davidxu@FreeBSD.org>

Add function prototypes.


# 093fcf16 14-Dec-2007 David Xu <davidxu@FreeBSD.org>

1. Add function pthread_mutex_setspinloops_np to turn a mutex's spin
loop count.
2. Add function pthread_mutex_setyieldloops_np to turn a mutex's yield
loop count.
3. Make environment variables

1. Add function pthread_mutex_setspinloops_np to turn a mutex's spin
loop count.
2. Add function pthread_mutex_setyieldloops_np to turn a mutex's yield
loop count.
3. Make environment variables PTHREAD_SPINLOOPS and PTHREAD_YIELDLOOPS
to be only used for turnning PTHREAD_MUTEX_ADAPTIVE_NP mutex.

show more ...


# 6a663207 11-Dec-2007 David Xu <davidxu@FreeBSD.org>

Enclose all code for macro ENQUEUE_MUTEX in do while statement, and
add missing brackets.

MFC: after 1 day


# b6b7fd3e 28-Nov-2007 Jason Evans <jasone@FreeBSD.org>

Fix pointer dereferencing problems in _pthread_mutex_init_calloc_cb() that
were obscured by pseudo-opaque pthreads API pointer casting.


123456789