summaryrefslogtreecommitdiff
path: root/src/modules/netlib/netlibupnp.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-07-02 22:30:27 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-07-02 22:30:27 +0000
commit980bcaff693a86971750d6e9ffc8ba1e561b8b3a (patch)
treed8a422e9ccd2357d6e28368447bee8cfcd26123a /src/modules/netlib/netlibupnp.cpp
parent990f961261d92fccadb16b495171bb619c0183f0 (diff)
the core without manual critical sections' control
git-svn-id: http://svn.miranda-ng.org/main/trunk@730 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules/netlib/netlibupnp.cpp')
-rw-r--r--src/modules/netlib/netlibupnp.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/modules/netlib/netlibupnp.cpp b/src/modules/netlib/netlibupnp.cpp
index 45009fa341..8bec975111 100644
--- a/src/modules/netlib/netlibupnp.cpp
+++ b/src/modules/netlib/netlibupnp.cpp
@@ -800,18 +800,16 @@ void NetlibUPnPCleanup(void*)
return;
{
- int i, incoming = 0;
- EnterCriticalSection(&csNetlibUser);
- for (i = 0; i < netlibUser.getCount(); ++i)
- {
- if (netlibUser[i]->user.flags & NUF_INCOMING)
- {
+ int incoming = 0;
+ mir_cslock lck(csNetlibUser);
+ for (int i = 0; i < netlibUser.getCount(); ++i)
+ if (netlibUser[i]->user.flags & NUF_INCOMING) {
incoming = 1;
break;
}
- }
- LeaveCriticalSection(&csNetlibUser);
- if ( !incoming) return;
+
+ if ( !incoming)
+ return;
}
if (findUPnPGateway())