tech-kern archive

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

Re: Deferred freeing of kauth_cred_ts

On Fri, Dec 25, 2009 at 3:56 AM, Iain Hibbert <> 
> On Fri, 25 Dec 2009, Elad Efrat wrote:
> +static void
> +kauth_cred_free_now(kauth_cred_t cred)
> since this function is so small and only called from one place (by
> design), should it not just go there?
> +static void
> +kauth_thread(void *cookie)
> and eg call this kauth_cleanup_thread (or if you think of a better name
> use that :)

I thought having the code that frees the credential in its own
function would help "organize" things, but I don't really mind. Same
thing for kauth_thread()...

> +       SLIST_INSERT_HEAD(&kauth_thread_discard, cred, cr_list);
> should access to this SLIST be protected by a mutex?  There could be a
> race between adding and removing..

Yeah... would an IPL_HIGH mutex be fine there? (if I read mutex(9)
right, we need a spin mutex for our purposes.)



Home | Main Index | Thread Index | Old Index