summaryrefslogtreecommitdiff
path: root/protocols/IcqOscarJ/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-03-12 20:34:18 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-03-12 20:34:18 +0000
commit44eb90b35fb7f6be9910d6d5e51bfeed36abe4c8 (patch)
treec7b15a375257ad0f0e4eeb0dcebe03fd23563880 /protocols/IcqOscarJ/src
parentd42e00ade03da9d1ac5c642bc32aa648fbe0c1d2 (diff)
more code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@12389 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/IcqOscarJ/src')
-rw-r--r--protocols/IcqOscarJ/src/icq_rates.cpp13
-rw-r--r--protocols/IcqOscarJ/src/icq_rates.h4
2 files changed, 6 insertions, 11 deletions
diff --git a/protocols/IcqOscarJ/src/icq_rates.cpp b/protocols/IcqOscarJ/src/icq_rates.cpp
index e681814afc..138c8900a2 100644
--- a/protocols/IcqOscarJ/src/icq_rates.cpp
+++ b/protocols/IcqOscarJ/src/icq_rates.cpp
@@ -328,11 +328,7 @@ void rates_queue::initDelay(int nDelay, IcqRateFunc delaycode)
void rates_queue::cleanup()
{
- mir_cslock l(listsMutex);
-
- if (lstPending.getCount())
- ppro->debugLogA("Rates: Purging %d %s(s).", lstPending.getCount(), szDescr);
-
+ mir_cslock l(csLists);
for (int i = 0; i < lstPending.getCount(); i++)
delete lstPending[i];
lstPending.destroy();
@@ -346,7 +342,7 @@ void rates_queue::processQueue()
}
// take from queue, execute
- mir_cslockfull l(listsMutex);
+ mir_cslockfull l(csLists);
if (lstPending.getCount() == 0)
return;
@@ -375,8 +371,7 @@ void rates_queue::processQueue()
}
else ppro->debugLogA("Rates: Discarding %s.", szDescr);
- if (bSetupTimer) {
- // in queue remained some items, setup timer
+ if (bSetupTimer) { // in queue remained some items, setup timer
int nDelay;
{
mir_cslockfull rlck(ppro->m_ratesMutex);
@@ -396,7 +391,7 @@ void rates_queue::putItem(rates_queue_item *pItem, int nMinDelay)
ppro->debugLogA("Rates: Delaying %s.", szDescr);
{
- mir_cslock l(listsMutex);
+ mir_cslock l(csLists);
if (lstPending.getCount()) {
for (int i = 0; i < lstPending.getCount(); i++) {
if (lstPending[i]->isEqual(pItem)) {
diff --git a/protocols/IcqOscarJ/src/icq_rates.h b/protocols/IcqOscarJ/src/icq_rates.h
index 9c6607d910..c3c8f560f3 100644
--- a/protocols/IcqOscarJ/src/icq_rates.h
+++ b/protocols/IcqOscarJ/src/icq_rates.h
@@ -127,7 +127,7 @@ class rates_queue : public MZeroedObject
const char *szDescr;
int duplicates;
- mir_cs listsMutex; // we need to be thread safe
+ mir_cs csLists; // we need to be thread safe
LIST<rates_queue_item> lstPending;
protected:
@@ -136,7 +136,7 @@ protected:
void initDelay(int nDelay, IcqRateFunc delaycode);
public:
- rates_queue(CIcqProto *ppro, const char *szDescr, int nLimitLevel, int nWaitLevel, int nDuplicates = 0);
+ rates_queue(CIcqProto *ppro, const char *szDescr, int nLimitLevel, int nWaitLevel, int nDuplicates);
~rates_queue();
void putItem(rates_queue_item *pItem, int nMinDelay);