summaryrefslogtreecommitdiff
path: root/protocols/MRA/Sdk/FIFOMT.h
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-09-27 12:37:42 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-09-27 12:37:42 +0000
commit3ef638023d476a91128f287fe454b547836a4b90 (patch)
tree46c8e3340f5ce59fdb8bce2ef758e3c32d78fb01 /protocols/MRA/Sdk/FIFOMT.h
parent6035c2ae283bd8743a7484ed8796bd845afec4d5 (diff)
automatic lock management
git-svn-id: http://svn.miranda-ng.org/main/trunk@1680 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/MRA/Sdk/FIFOMT.h')
-rw-r--r--protocols/MRA/Sdk/FIFOMT.h34
1 files changed, 9 insertions, 25 deletions
diff --git a/protocols/MRA/Sdk/FIFOMT.h b/protocols/MRA/Sdk/FIFOMT.h
index d15ae3e596..acff96f500 100644
--- a/protocols/MRA/Sdk/FIFOMT.h
+++ b/protocols/MRA/Sdk/FIFOMT.h
@@ -62,13 +62,8 @@ typedef PCLIST_MT_ITERATOR PCFIFO_MT_ITERATOR, LPCFIFO_MT_ITERATOR;
__inline size_t FifoMTItemPush(PCFIFO_MT pcpmtFifoMT,PCFIFO_MT_ITEM pcffmtiFifoItem,LPVOID lpData)
{
- size_t dwRet;
-
- ListMTLock(pcpmtFifoMT);
- dwRet=ListMTItemAdd(pcpmtFifoMT,pcffmtiFifoItem,lpData);
- ListMTUnLock(pcpmtFifoMT);
-
-return(dwRet);
+ mt_lock l(pcpmtFifoMT);
+ return ListMTItemAdd(pcpmtFifoMT,pcffmtiFifoItem,lpData);
}
@@ -77,39 +72,28 @@ __inline DWORD FifoMTItemPop(PCFIFO_MT pcpmtFifoMT,PFIFO_MT_ITEM *ppffmtiFifoIte
DWORD dwRetErrorCode;
PLIST_MT_ITEM plmtiItem;
- ListMTLock(pcpmtFifoMT);
+ mt_lock l(pcpmtFifoMT);
if ((dwRetErrorCode=ListMTItemGetFirst(pcpmtFifoMT,&plmtiItem,plpData))==NO_ERROR)
{
if (ppffmtiFifoItem) (*ppffmtiFifoItem)=plmtiItem;
- dwRetErrorCode=ListMTItemDelete(pcpmtFifoMT,plmtiItem);
+ return ListMTItemDelete(pcpmtFifoMT,plmtiItem);
}
- ListMTUnLock(pcpmtFifoMT);
-return(dwRetErrorCode);
+ return dwRetErrorCode;
}
__inline DWORD FifoMTItemGetFirst(PCFIFO_MT pcpmtFifoMT,PFIFO_MT_ITEM *ppffmtiFifoItem,LPVOID *plpData)
{
- DWORD dwRetErrorCode;
-
- ListMTLock(pcpmtFifoMT);
- dwRetErrorCode=ListMTItemGetFirst(pcpmtFifoMT,ppffmtiFifoItem,plpData);
- ListMTUnLock(pcpmtFifoMT);
-
-return(dwRetErrorCode);
+ mt_lock l(pcpmtFifoMT);
+ return ListMTItemGetFirst(pcpmtFifoMT,ppffmtiFifoItem,plpData);
}
__inline DWORD FifoMTItemGetLast(PCFIFO_MT pcpmtFifoMT,PFIFO_MT_ITEM *ppffmtiFifoItem,LPVOID *plpData)
{
- DWORD dwRetErrorCode;
-
- ListMTLock(pcpmtFifoMT);
- dwRetErrorCode=ListMTItemGetLast(pcpmtFifoMT,ppffmtiFifoItem,plpData);
- ListMTUnLock(pcpmtFifoMT);
-
-return(dwRetErrorCode);
+ mt_lock l(pcpmtFifoMT);
+ return ListMTItemGetLast(pcpmtFifoMT,ppffmtiFifoItem,plpData);
}