Stefan Berger/Watson/IBM wrote on 03/22/2012 03:04:53 PM:
I have some concerns about the cancelation of the thread. It can
hold the snoop lock and get cancelled while holding it. Next time
that lock is grabbed we will get a deadlock...
The snoop lock is acquired in virNWFilterDHCPSnoopEnd(), which
is where the pthread_cancel() directly (for valid leases) or the
freeReq()/pthread_cancel() is done. So, the canceler has the lock
and the canceling thread can't have it, then.
The only other case I see is when the config goes invalid and
we exit the snooper loop; he frees the snoop_lock() before removing
his own hash entry, which will cancel the same thread doing
the remove. Again, it can't have the snoop lock when canceled.
Is there some other case you think I'm missing?
+-DLS