oops.. used the wrong email from address to reply. there is a mutex around this code. what I changed was to add the cleanup_cache_object into the mutex lock
Ryan Bloom wrote: > Doesn't the race condition still exist? For example, I can delete the > object after the if but before the hash_set. You need a mutex, don't > you? > > Ryan > > >> - apr_hash_set(sconf->cacheht, obj->key, strlen(obj->key), NULL); >> + /* >> + * RACE .. some one might have just deleted this object .. so >> > test > >> + * if it is still around >> + */ >> + if (obj) { >> + apr_hash_set(sconf->cacheht, obj->key, strlen(obj->key), >> > NULL); > >> + cleanup_cache_object(obj); >> + h->cache_obj = NULL; >> + } >> if (sconf->lock) { >> apr_thread_mutex_unlock(sconf->lock); >> - } >> - >> - cleanup_cache_object(obj); >> + } >> >> return OK; >> } >> >> >> >> >