[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: race condition in libports

From: Brent W. Baccala
Subject: Re: race condition in libports
Date: Sun, 17 Dec 2017 23:41:57 -0500

On Sun, Dec 17, 2017 at 8:02 AM, Samuel Thibault <samuel.thibault@gnu.org> wrote:

Brent W. Baccala, on sam. 16 déc. 2017 21:37:05 -0500, wrote:
> basically, we're storing ports in a inode-to-port hash, looking them
> up when io_identity() gets called, and removing them from the hash
> when the class's clean routine gets called.

That's the bug: one needs a reference for this.  And it's a weak
reference: identity is fine with getting rid of it.  Could you try the
attached patch?

Makes sense.  I've applied it.  So far, so good.

Now I feel stupid!  Holding a port in a hash is such a classic example of a weak reference, but I didn't even think about moving that code out of the clean function.

Thank you.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]