summaryrefslogtreecommitdiff
path: root/protocols/SkypeWeb/src/skype_utils.h
diff options
context:
space:
mode:
authorMikalaiR <nikolay.romanovich@narod.ru>2015-09-23 19:23:39 +0000
committerMikalaiR <nikolay.romanovich@narod.ru>2015-09-23 19:23:39 +0000
commit037511a364629d200c22cd08e0fa4922f2429bfc (patch)
tree510680699b0e8eb046b771b9de350b20fd0e7fa8 /protocols/SkypeWeb/src/skype_utils.h
parenta8dfca9c4a079c6d9706fa819b8993a2df5d7270 (diff)
SkypeWeb: code optimization
git-svn-id: http://svn.miranda-ng.org/main/trunk@15429 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/SkypeWeb/src/skype_utils.h')
-rw-r--r--protocols/SkypeWeb/src/skype_utils.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/protocols/SkypeWeb/src/skype_utils.h b/protocols/SkypeWeb/src/skype_utils.h
index b50b65546a..1a608bce47 100644
--- a/protocols/SkypeWeb/src/skype_utils.h
+++ b/protocols/SkypeWeb/src/skype_utils.h
@@ -76,5 +76,35 @@ public:
__inline char *get_reason() { return mir_strdup(szReason); }
};
+class EventHandle
+{
+ HANDLE _hEvent;
+public:
+ inline EventHandle()
+ {
+ _hEvent = CreateEvent(NULL, 0, 0, NULL);
+ }
+ inline ~EventHandle()
+ {
+ CloseHandle(_hEvent);
+ }
+ inline void Set()
+ {
+ SetEvent(_hEvent);
+ }
+ inline void Wait()
+ {
+ WaitForSingleObject(_hEvent, INFINITE);
+ }
+ inline void Wait(DWORD dwMilliseconds)
+ {
+ WaitForSingleObject(_hEvent, dwMilliseconds);
+ }
+ inline operator HANDLE()
+ {
+ return _hEvent;
+ }
+};
+
#endif //_UTILS_H_ \ No newline at end of file