<p dir="ltr">On Jul 20, 2016 4:50 PM, "Dmitry V. Levin" <<a href="mailto:ldv@altlinux.org">ldv@altlinux.org</a>> wrote:<br>
><br>
> On Mon, Sep 07, 2015 at 08:23:57PM +0200, Patrik Jakobsson wrote:<br>
> > On Mon, Sep 7, 2015 at 6:51 PM, Dmitry V. Levin wrote:<br>
> > > On Mon, Aug 31, 2015 at 02:37:07PM +0200, Patrik Jakobsson wrote:<br>
> > > [...]<br>
> > >> Here's my take on it (I assume it needs some discussion):<br>
> > >><br>
> > >> int<br>
> > >> set_tcb_priv_data(struct tcb *tcp, void *priv_data)<br>
> > >> {<br>
> > >> /* A free callback is required before setting private data and private<br>
> > >> * data must be set back to NULL before being set again.<br>
> > >> */<br>
> > ><br>
> > > I think a single function initializing both _priv_data and _free_priv_data<br>
> > > would suffice:<br>
> > ><br>
> > > int<br>
> > > set_tcb_priv_data(struct tcb *tcp, void *priv_data,<br>
> > > void (*free_priv_data)(void *))<br>
> > > {<br>
> > > if (tcp->_priv_data)<br>
> > > return -1;<br>
> > ><br>
> > > tcp->_free_priv_data = free_priv_data;<br>
> > > tcp->_priv_data = priv_data;<br>
> > ><br>
> > > return 0;<br>
> > > }<br>
> ><br>
> > Sure, and since they always come in a pairs it might be even better. If it turns<br>
> > out we need it split up it is easily done later.<br>
><br>
> JFYI, I've finalized and merged this set_tcb_priv_data interface.</p>
<p dir="ltr">Thanks Dmitry</p>
<p dir="ltr">-Patrik</p>
<p dir="ltr">><br>
><br>
> --<br>
> ldv<br></p>