the StoreEntry unlock() method.
/*
- * $Id: Server.cc,v 1.3 2006/02/17 18:10:59 wessels Exp $
+ * $Id: Server.cc,v 1.4 2006/05/19 17:05:18 wessels Exp $
*
* DEBUG:
* AUTHOR: Duane Wessels
ServerStateData::~ServerStateData()
{
- storeUnlockObject(entry);
+ entry->unlock();
HTTPMSGUNLOCK(request);
HTTPMSGUNLOCK(reply);
/*
- * $Id: Store.h,v 1.20 2006/05/03 14:04:44 robertc Exp $
+ * $Id: Store.h,v 1.21 2006/05/19 17:05:18 wessels Exp $
*
*
* SQUID Web Proxy Cache http://www.squid-cache.org/
SQUIDCEXTERN void storeAppend(StoreEntry *, const char *, int);
SQUIDCEXTERN void storeLockObject(StoreEntry *);
SQUIDCEXTERN void storeRelease(StoreEntry *);
-SQUIDCEXTERN int storeUnlockObject(StoreEntry *);
SQUIDCEXTERN void storeExpireNow(StoreEntry *);
SQUIDCEXTERN void storeReleaseRequest(StoreEntry *);
SQUIDCEXTERN void storeConfigure(void);
/*
- * $Id: asn.cc,v 1.105 2006/05/03 14:04:44 robertc Exp $
+ * $Id: asn.cc,v 1.106 2006/05/19 17:05:18 wessels Exp $
*
* DEBUG: section 53 AS Number handling
* AUTHOR: Duane Wessels, Kostas Anagnostakis
ASState *asState = (ASState *)data;
debug(53, 3) ("asnStateFree: %s\n", storeUrl(asState->entry));
storeUnregister(asState->sc, asState->entry, asState);
- storeUnlockObject(asState->entry);
+ asState->entry->unlock();
HTTPMSGUNLOCK(asState->request);
cbdataFree(asState);
}
/*
- * $Id: cache_manager.cc,v 1.40 2006/05/08 23:38:33 robertc Exp $
+ * $Id: cache_manager.cc,v 1.41 2006/05/19 17:05:18 wessels Exp $
*
* DEBUG: section 16 Cache Manager Objects
* AUTHOR: Duane Wessels
safe_free(mgr->action);
safe_free(mgr->user_name);
safe_free(mgr->passwd);
- storeUnlockObject(mgr->entry);
+ mgr->entry->unlock();
xfree(mgr);
}
/*
- * $Id: client_side_reply.cc,v 1.105 2006/05/08 23:38:33 robertc Exp $
+ * $Id: client_side_reply.cc,v 1.106 2006/05/19 17:05:18 wessels Exp $
*
* DEBUG: section 88 Client-side Reply Routines
* AUTHOR: Robert Collins (Originally Duane Wessels in client_side.c)
*ep = NULL;
storeUnregister(sc, e, this);
*scp = NULL;
- storeUnlockObject(e);
+ e->unlock();
}
}
/*
- * $Id: client_side_request.cc,v 1.66 2006/05/11 23:53:13 wessels Exp $
+ * $Id: client_side_request.cc,v 1.67 2006/05/19 17:05:18 wessels Exp $
*
* DEBUG: section 85 Client-side Request Routines
* AUTHOR: Robert Collins (Originally Duane Wessels in client_side.c)
ClientHttpRequest::loggingEntry(StoreEntry *newEntry)
{
if (loggingEntry_)
- storeUnlockObject(loggingEntry_);
+ loggingEntry_->unlock();
loggingEntry_ = newEntry;
/*
- * $Id: errorpage.cc,v 1.212 2006/05/08 23:38:33 robertc Exp $
+ * $Id: errorpage.cc,v 1.213 2006/05/19 17:05:18 wessels Exp $
*
* DEBUG: section 4 Error Generation
* AUTHOR: Duane Wessels
entry->complete();
storeNegativeCache(entry);
storeReleaseRequest(entry);
- storeUnlockObject(entry);
+ entry->unlock();
errorStateFree(err);
}
/*
- * $Id: forward.cc,v 1.142 2006/05/08 23:38:33 robertc Exp $
+ * $Id: forward.cc,v 1.143 2006/05/19 17:05:18 wessels Exp $
*
* DEBUG: section 17 Request Forwarding
* AUTHOR: Duane Wessels
if (err)
errorStateFree(err);
- storeUnlockObject(entry);
+ entry->unlock();
entry = NULL;
/*
- * $Id: gopher.cc,v 1.195 2006/05/08 23:38:33 robertc Exp $
+ * $Id: gopher.cc,v 1.196 2006/05/19 17:05:18 wessels Exp $
*
* DEBUG: section 10 Gopher
* AUTHOR: Harvest Derived
return;
if (gopherState->entry) {
- storeUnlockObject(gopherState->entry);
+ gopherState->entry->unlock();
}
HTTPMSGUNLOCK(gopherState->req);
/*
- * $Id: mime.cc,v 1.126 2006/05/06 22:13:18 wessels Exp $
+ * $Id: mime.cc,v 1.127 2006/05/19 17:05:18 wessels Exp $
*
* DEBUG: section 25 MIME Parsing
* AUTHOR: Harvest Derived
debug(25, 3) ("Loaded icon %s\n", url);
- storeUnlockObject(e);
+ e->unlock();
memFree(buf, MEM_4K_BUF);
}
/*
- * $Id: neighbors.cc,v 1.335 2006/05/08 23:38:33 robertc Exp $
+ * $Id: neighbors.cc,v 1.336 2006/05/19 17:05:18 wessels Exp $
*
* DEBUG: section 15 Neighbor Routines
* AUTHOR: Harvest Derived
EBIT_SET(fake->flags, ENTRY_ABORTED);
HTTPMSGUNLOCK(fake->mem_obj->request);
storeReleaseRequest(fake);
- storeUnlockObject(fake);
+ fake->unlock();
HTTPMSGUNLOCK(psstate->request);
cbdataFree(psstate);
}
/*
- * $Id: net_db.cc,v 1.187 2006/05/08 23:38:33 robertc Exp $
+ * $Id: net_db.cc,v 1.188 2006/05/19 17:05:18 wessels Exp $
*
* DEBUG: section 38 Network Measurement Database
* AUTHOR: Duane Wessels
debug(38, 3) ("netdbExchangeDone: %s\n", storeUrl(ex->e));
HTTPMSGUNLOCK(ex->r);
storeUnregister(ex->sc, ex->e, ex);
- storeUnlockObject(ex->e);
+ ex->e->unlock();
cbdataReferenceDone(ex->p);
cbdataFree(ex);
}
/*
- * $Id: peer_digest.cc,v 1.113 2006/05/08 23:38:33 robertc Exp $
+ * $Id: peer_digest.cc,v 1.114 2006/05/19 17:05:18 wessels Exp $
*
* DEBUG: section 72 Peer Digest Routines
* AUTHOR: Alex Rousskov
/* get rid of 304 reply */
storeUnregister(fetch->sc, fetch->entry, fetch);
- storeUnlockObject(fetch->entry);
+ fetch->entry->unlock();
fetch->entry = fetch->old_entry;
debug(72, 3) ("peerDigestFetchReply: got new digest, releasing old one\n");
storeUnregister(fetch->old_sc, fetch->old_entry, fetch);
storeReleaseRequest(fetch->old_entry);
- storeUnlockObject(fetch->old_entry);
+ fetch->old_entry->unlock();
fetch->old_entry = NULL;
}
} else {
debug(72, 2) ("peerDigestFetchFinish: deleting old entry\n");
storeUnregister(fetch->old_sc, fetch->old_entry, fetch);
storeReleaseRequest(fetch->old_entry);
- storeUnlockObject(fetch->old_entry);
+ fetch->old_entry->unlock();
fetch->old_entry = NULL;
}
/* unlock everything */
storeUnregister(fetch->sc, fetch->entry, fetch);
- storeUnlockObject(fetch->entry);
+ fetch->entry->unlock();
HTTPMSGUNLOCK(fetch->request);
/*
- * $Id: peer_select.cc,v 1.138 2006/02/17 18:10:59 wessels Exp $
+ * $Id: peer_select.cc,v 1.139 2006/05/19 17:05:18 wessels Exp $
*
* DEBUG: section 44 Peer Selection Algorithm
* AUTHOR: Duane Wessels
if (psstate->entry) {
assert(psstate->entry->ping_status != PING_WAITING);
- storeUnlockObject(psstate->entry);
+ psstate->entry->unlock();
psstate->entry = NULL;
}
/*
- * $Id: store_repl_heap.cc,v 1.18 2006/04/23 11:10:35 robertc Exp $
+ * $Id: store_repl_heap.cc,v 1.19 2006/05/19 17:05:18 wessels Exp $
*
* DEBUG: section ? HEAP based removal policies
* AUTHOR: Henrik Nordstrom
while ((entry = (StoreEntry *)linklistShift(&heap_walker->locked_entries))) {
heap_node *node = heap_insert(heap->theHeap, entry);
heap->setPolicyNode(entry, node);
- storeUnlockObject(entry);
+ entry->unlock();
}
safe_free(walker->_data);
/*
- * $Id: stat.cc,v 1.392 2005/09/17 05:50:08 wessels Exp $
+ * $Id: stat.cc,v 1.393 2006/05/19 17:05:18 wessels Exp $
*
* DEBUG: section 18 Cache Manager Statistics
* AUTHOR: Harvest Derived
if (state->theSearch->isDone()) {
state->sentry->complete();
- storeUnlockObject(state->sentry);
+ state->sentry->unlock();
cbdataFree(state);
return;
} else if (EBIT_TEST(state->sentry->flags, ENTRY_ABORTED)) {
- storeUnlockObject(state->sentry);
+ state->sentry->unlock();
cbdataFree(state);
return;
} else if (state->sentry->checkDeferRead(-1)) {
/*
- * $Id: store.cc,v 1.589 2006/05/08 23:38:33 robertc Exp $
+ * $Id: store.cc,v 1.590 2006/05/19 17:05:18 wessels Exp $
*
* DEBUG: section 20 Storage Manager
* AUTHOR: Harvest Derived
storeSetPrivateKey(e);
}
-/* DEPRECATED: please use e->unlock() */
-int
-storeUnlockObject(StoreEntry * e)
-{
- return e->unlock();
-}
-
/* unlock object, return -1 if object get released after unlock
* otherwise lock_count */
int
StoreEntry::unlock()
{
lock_count--;
- debug(20, 3) ("storeUnlockObject: key '%s' count=%d\n",
+ debug(20, 3) ("StoreEntry::unlock: key '%s' count=%d\n",
getMD5Text(), lock_count);
if (lock_count)
storeBufferFlush(pe);
storeTimestampsSet(pe);
pe->complete();
- storeUnlockObject(pe);
+ pe->unlock();
}
newkey = storeKeyPublicByRequest(mem->request);
/* Close any swapout file */
storeSwapOutFileClose(e);
- storeUnlockObject(e); /* unlock */
+ e->unlock(); /* unlock */
}
/* Clear Memory storage to accommodate the given object len */
if (e->swap_filen > -1) {
/*
* Fake a call to storeLockObject(). When rebuilding is done,
- * we'll just call storeUnlockObject() on these.
+ * we'll just call e->unlock() on these.
*/
e->lock_count++;
e->setReleaseFlag();
return;
}
- storeUnlockObject(e);
+ e->unlock();
n++;
}
/*
- * $Id: store_digest.cc,v 1.65 2006/05/08 23:38:33 robertc Exp $
+ * $Id: store_digest.cc,v 1.66 2006/05/19 17:05:18 wessels Exp $
*
* DEBUG: section 71 Store Digest Manager
* AUTHOR: Alex Rousskov
(long int) e->expires, (int) (e->expires - squid_curtime));
/* is this the write order? @?@ */
e->mem_obj->unlinkRequest();
- storeUnlockObject(e);
+ e->unlock();
cbdataFree(sd_state.rewrite_lock);
sd_state.rewrite_lock = NULL;
sd_state.rewrite_count++;
/*
- * $Id: store_swapout.cc,v 1.101 2005/09/14 18:23:21 wessels Exp $
+ * $Id: store_swapout.cc,v 1.102 2006/05/19 17:05:18 wessels Exp $
*
* DEBUG: section 20 Storage Manager Swapout Functions
* AUTHOR: Duane Wessels
debug(20, 3) ("storeSwapOutFileClosed: %s:%d\n", __FILE__, __LINE__);
mem->swapout.sio = NULL;
- storeUnlockObject(e);
+ e->unlock();
}
/*
storeSwapOut(pe);
CPPUNIT_ASSERT(pe->swap_dirn == 0);
CPPUNIT_ASSERT(pe->swap_filen == 0);
- storeUnlockObject(pe);
+ pe->unlock();
}
storeDirWriteCleanLogs(0);
storeSwapOut(pe);
/* Null does not accept store entries */
CPPUNIT_ASSERT(pe->swap_dirn == -1);
- storeUnlockObject(pe);
+ pe->unlock();
}
storeDirWriteCleanLogs(0);
storeSwapOut(pe);
CPPUNIT_ASSERT(pe->swap_dirn == 0);
CPPUNIT_ASSERT(pe->swap_filen == 0);
- storeUnlockObject(pe);
+ pe->unlock();
}
storeDirWriteCleanLogs(0);
/*
- * $Id: urn.cc,v 1.99 2006/05/08 23:38:33 robertc Exp $
+ * $Id: urn.cc,v 1.100 2006/05/19 17:05:18 wessels Exp $
*
* DEBUG: section 52 URN Parsing
* AUTHOR: Kostas Anagnostakis
storeUnregister(urnState->sc, urlres_e, urnState);
error:
- storeUnlockObject(urlres_e);
- storeUnlockObject(urnState->entry);
+ urlres_e->unlock();
+ urnState->entry->unlock();
HTTPMSGUNLOCK(urnState->request);
HTTPMSGUNLOCK(urnState->urlres_r);
delete urnState;
/*
- * $Id: wais.cc,v 1.158 2006/05/08 23:38:33 robertc Exp $
+ * $Id: wais.cc,v 1.159 2006/05/19 17:05:18 wessels Exp $
*
* DEBUG: section 24 WAIS Relay
* AUTHOR: Harvest Derived
if (waisState == NULL)
return;
- storeUnlockObject(waisState->entry);
+ waisState->entry->unlock();
HTTPMSGUNLOCK(waisState->request);
/*
- * $Id: whois.cc,v 1.33 2006/02/17 20:15:35 wessels Exp $
+ * $Id: whois.cc,v 1.34 2006/05/19 17:05:18 wessels Exp $
*
* DEBUG: section 75 WHOIS protocol
* AUTHOR: Duane Wessels, Kostas Anagnostakis
{
WhoisState *p = (WhoisState *)data;
debug(75, 3) ("whoisClose: FD %d\n", fd);
- storeUnlockObject(p->entry);
+ p->entry->unlock();
cbdataFree(p);
}