Re: [lxc-devel] [PATCH RFC] Fix up struct lxc_container locking

2013-04-15 Thread Seth Arnold
On Thu, Apr 11, 2013 at 11:43:31AM -0500, Serge Hallyn wrote: > 1. in container_free, set c->privlock to NULL before calling > sem_destroy, to prevent a window where another thread could call > sem_wait(c->privlock) while c->privlock is not NULL but is already > destroyed. > > 2. in container_get,

Re: [lxc-devel] [PATCH RFC] Fix up struct lxc_container locking

2013-04-11 Thread Stéphane Graber
On 04/11/2013 06:43 PM, Serge Hallyn wrote: > 1. in container_free, set c->privlock to NULL before calling > sem_destroy, to prevent a window where another thread could call > sem_wait(c->privlock) while c->privlock is not NULL but is already > destroyed. > > 2. in container_get, check for numthre

Re: [lxc-devel] [PATCH RFC] Fix up struct lxc_container locking

2013-04-11 Thread Serge Hallyn
Quoting Seth Arnold (seth.arn...@canonical.com): > On Thu, Apr 11, 2013 at 11:43:31AM -0500, Serge Hallyn wrote: > > 1. in container_free, set c->privlock to NULL before calling > > sem_destroy, to prevent a window where another thread could call > > sem_wait(c->privlock) while c->privlock is not N

[lxc-devel] [PATCH RFC] Fix up struct lxc_container locking

2013-04-11 Thread Serge Hallyn
1. in container_free, set c->privlock to NULL before calling sem_destroy, to prevent a window where another thread could call sem_wait(c->privlock) while c->privlock is not NULL but is already destroyed. 2. in container_get, check for numthreads < 0 before calling lxclock. Once numthreads is 0, it