svn commit: r215170 - in user/davidxu/libthr/sys: kern sys
Jilles Tjoelker
jilles at stack.nl
Tue Nov 16 22:26:22 UTC 2010
On Fri, Nov 12, 2010 at 09:34:21AM +0000, David Xu wrote:
> Author: davidxu
> Date: Fri Nov 12 09:34:21 2010
> New Revision: 215170
> URL: http://svn.freebsd.org/changeset/base/215170
> Log:
> Limit total number of robust mutexes a process can hold.
I think a per thread limit is better as it is more predictable. If the
limit is exceeded, pthread_mutex_lock() will fail.
> [...]
> + error = msleep(&max_robust_per_proc,
> + &max_robust_lock, 0, "maxrob", 0);
I think a PCATCH flag was intended here.
If you want to do it this way, it needs to wake up if another thread in
the process unlocks something.
If one thread uses up max_robust_per_proc, it is stuck forever. It is
also possible though rare that this wait forms a cycle with lock waits.
--
Jilles Tjoelker
More information about the svn-src-user
mailing list