From b9a98ecb39c7c39380d34b43fd3bb1192fefb667 Mon Sep 17 00:00:00 2001 From: methodus Date: Tue, 6 Nov 2012 02:59:37 +0100 Subject: Changed ScanUri function a little bit to avoid segfaults. --- include/media/requestCounter.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/media/requestCounter.h b/include/media/requestCounter.h index dc8a330..a69b4aa 100644 --- a/include/media/requestCounter.h +++ b/include/media/requestCounter.h @@ -8,12 +8,18 @@ #ifndef REQUESTCOUNTER_H_ #define REQUESTCOUNTER_H_ +#include "../tools/atomic.h" + +namespace upnp { + struct request_counter_t { // Should be std::atomic. Unfortunatelly, it's supported on C++11 only. // Hope, it works anyway. - static int OPEN_REQUESTS; + static tools::atomic::AtomicInteger OPEN_REQUESTS; request_counter_t(){++OPEN_REQUESTS;} ~request_counter_t(){--OPEN_REQUESTS;} }; +} // namespace upnp + #endif /* REQUESTCOUNTER_H_ */ -- cgit v1.2.3