bug-hurd
[Top][All Lists]
Advanced

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

Re: [PATCH 7/7] libtrivfs: lock-less reference counting for trivfs_perop


From: Samuel Thibault
Subject: Re: [PATCH 7/7] libtrivfs: lock-less reference counting for trivfs_peropen objects
Date: Sat, 24 May 2014 10:50:40 +0200
User-agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30)

Justus Winter, le Fri 23 May 2014 09:48:35 +0200, a écrit :
> It is an optimization.  This way we can use just 1 atomic operation
> when trivfs_peropen_destroy_hook is not used, and 3 when it is.  If we
> do it like you described, we need two in any case.

Then you could rather use something like:

if (trivfs_peropen_destroy_hook)
{
  do it in two operations
}
else
{
  do it in one operation
}

It doesn't duplicate too much code.

Samuel



reply via email to

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