Paul Querna wrote:
This deals with removing an event from the pollset, but what about an event that had already fired, as I gave in the original example of a timeout event firing the same time a socket close event happened?
In that case I suppose the only solution is to make the operations atomic. Since both operations would lead to the same result (closing a connection) I suppose an atomic state flag should be enough.
In that state you have two threads both in a 'run state' for a connection, and I'm not sure how the pre-cleanup to pools solves this in any way?
It won't because the cleanup pool API doesn't bother with cleanup callback return values, so there's no way to bail out from the pool cleanup call. I suppose we could modify the pre-cleanup to handle the retval from callback and breaks the entire pool cleanup if one of them returns something other then APR_SUCCESS. Then the callback function can decide weather there is a pending close operation or not. Regards -- ^(TM)
