> It owns the lock, but hasn't yet updated the lock's owner
> (lock->tstate), so another thread calling detect_circularity() will
> think that this lock is available, and will proceed, which can
> eventually lead to a deadlock.
That's true. Do you think temptatively acquiring the lock (without
blocking) would solve the issue?
> Also, I think that locks will use POSIX semaphores on systems that
> support only a limited number of them (such as FreeBSD 7), and this
> might fail in case of nested imports (the infamous ENFILE). I'd have
> to double check this, though.
Isn't this limit only about named semaphores? Or does it apply to
anonymous semaphores as well? |