summaryrefslogtreecommitdiff
path: root/protocols/FacebookRM/src/stdafx.h
diff options
context:
space:
mode:
authorRobert Pösel <robyer@seznam.cz>2015-10-20 09:37:29 +0000
committerRobert Pösel <robyer@seznam.cz>2015-10-20 09:37:29 +0000
commitaaef083794f6e88034ae40549dcf595ac161bd55 (patch)
treeee62a6ef55a573edf307be79b1560dbebf9d916f /protocols/FacebookRM/src/stdafx.h
parent1b270f957517df4def8cf85ee3dc75050cce3357 (diff)
Facebook: Adapt to use std_string_utils
git-svn-id: http://svn.miranda-ng.org/main/trunk@15576 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/FacebookRM/src/stdafx.h')
-rw-r--r--protocols/FacebookRM/src/stdafx.h27
1 files changed, 25 insertions, 2 deletions
diff --git a/protocols/FacebookRM/src/stdafx.h b/protocols/FacebookRM/src/stdafx.h
index 2e16e05152..1e832cd94a 100644
--- a/protocols/FacebookRM/src/stdafx.h
+++ b/protocols/FacebookRM/src/stdafx.h
@@ -64,12 +64,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
class FacebookProto;
+#include "../../utils/std_string_utils.h"
+
#include "constants.h"
#include "definitions.h"
#include "entities.h"
#include "http.h"
#include "list.hpp"
-#include "utils.h"
#include "client.h"
#include "proto.h"
#include "json.h"
@@ -81,4 +82,26 @@ class FacebookProto;
extern HINSTANCE g_hInstance;
extern std::string g_strUserAgent;
-extern DWORD g_mirandaVersion; \ No newline at end of file
+extern DWORD g_mirandaVersion;
+
+class ScopedLock
+{
+public:
+ ScopedLock(HANDLE h, int t = INFINITE) : handle_(h), timeout_(t)
+ {
+ WaitForSingleObject(handle_,timeout_);
+ }
+ ~ScopedLock()
+ {
+ if(handle_)
+ ReleaseMutex(handle_);
+ }
+ void Unlock()
+ {
+ ReleaseMutex(handle_);
+ handle_ = 0;
+ }
+private:
+ HANDLE handle_;
+ int timeout_;
+};