From: wessels <> Date: Thu, 16 Apr 1998 23:47:27 +0000 (+0000) Subject: lock entries during abort X-Git-Tag: SQUID_3_0_PRE1~3499 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3d02186d7a6be293d83a5146a9ce8c6b2684a5d5;p=thirdparty%2Fsquid.git lock entries during abort --- diff --git a/src/store.cc b/src/store.cc index 69d41be22c..7cee257a00 100644 --- a/src/store.cc +++ b/src/store.cc @@ -1,6 +1,6 @@ /* - * $Id: store.cc,v 1.403 1998/04/09 11:32:10 rousskov Exp $ + * $Id: store.cc,v 1.404 1998/04/16 17:47:27 wessels Exp $ * * DEBUG: section 20 Storage Manager * AUTHOR: Harvest Derived @@ -561,6 +561,7 @@ storeAbort(StoreEntry * e, int cbflag) assert(e->store_status == STORE_PENDING); assert(mem != NULL); debug(20, 6) ("storeAbort: %s\n", storeKeyText(e->key)); + storeLockObject(e); /* lock while aborting */ storeNegativeCache(e); storeReleaseRequest(e); e->store_status = STORE_ABORTED; @@ -585,18 +586,17 @@ storeAbort(StoreEntry * e, int cbflag) #if USE_ASYNC_IO aioCancel(-1, e); #endif - if (e->swap_file_number == -1) - return; + if (e->swap_file_number > -1) { #if USE_ASYNC_IO - /* Need to cancel any pending ASYNC writes right now */ - if (mem->swapout.fd >= 0) - aioCancel(mem->swapout.fd, NULL); + /* Need to cancel any pending ASYNC writes right now */ + if (mem->swapout.fd >= 0) + aioCancel(mem->swapout.fd, NULL); #endif - /* but dont close if a disk write is queued, the handler will close up */ - if (mem->swapout.queue_offset > mem->swapout.done_offset) - return; - /* we do */ - storeSwapOutFileClose(e); + /* we have to close the disk file if there is no write pending */ + if (mem->swapout.queue_offset == mem->swapout.done_offset) + storeSwapOutFileClose(e); + } + storeUnlockObject(e); /* unlock */ } /* Clear Memory storage to accommodate the given object len */ @@ -1131,8 +1131,8 @@ HttpReply * storeEntryReply(StoreEntry * e) { if (NULL == e) - return NULL; + return NULL; if (NULL == e->mem_obj) - return NULL; + return NULL; return e->mem_obj->reply; }