diff options
author | George Hazan <ghazan@miranda.im> | 2018-01-04 21:02:56 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-01-04 21:02:56 +0300 |
commit | 1b89cbba1f3bc00ea24a8414b2e670c582ac5fc4 (patch) | |
tree | 76ac43351cbbdbece75774d6f7bbf1e89b6cdca8 /protocols/FacebookRM/src/proto.cpp | |
parent | 5b32a855e518f67589fd49837795a605a19badce (diff) |
Facebook: switch to mir_cs instead of custom lock
Diffstat (limited to 'protocols/FacebookRM/src/proto.cpp')
-rw-r--r-- | protocols/FacebookRM/src/proto.cpp | 29 |
1 files changed, 3 insertions, 26 deletions
diff --git a/protocols/FacebookRM/src/proto.cpp b/protocols/FacebookRM/src/proto.cpp index f46b558c63..e2fde204d4 100644 --- a/protocols/FacebookRM/src/proto.cpp +++ b/protocols/FacebookRM/src/proto.cpp @@ -28,15 +28,7 @@ FacebookProto::FacebookProto(const char* proto_name, const wchar_t* username) : { facy.parent = this; - signon_lock_ = CreateMutex(nullptr, FALSE, nullptr); - avatar_lock_ = CreateMutex(nullptr, FALSE, nullptr); - log_lock_ = CreateMutex(nullptr, FALSE, nullptr); - update_loop_lock_ = CreateEvent(nullptr, FALSE, FALSE, nullptr); - facy.send_message_lock_ = CreateMutex(nullptr, FALSE, nullptr); - facy.fcb_conn_lock_ = CreateMutex(nullptr, FALSE, nullptr); - facy.notifications_lock_ = CreateMutex(nullptr, FALSE, nullptr); - facy.cookies_lock_ = CreateMutex(nullptr, FALSE, nullptr); - facy.loading_history_lock_ = CreateMutex(nullptr, FALSE, nullptr); + update_loop_event = CreateEvent(nullptr, FALSE, FALSE, nullptr); // Initialize random seed for this client facy.random_ = ::time(nullptr) + PtrToUint(&facy); @@ -122,23 +114,8 @@ FacebookProto::~FacebookProto() Netlib_CloseHandle(m_hNetlibUser); - WaitForSingleObject(signon_lock_, IGNORE); - WaitForSingleObject(avatar_lock_, IGNORE); - WaitForSingleObject(log_lock_, IGNORE); - WaitForSingleObject(facy.send_message_lock_, IGNORE); - WaitForSingleObject(facy.notifications_lock_, IGNORE); - WaitForSingleObject(facy.cookies_lock_, IGNORE); - WaitForSingleObject(facy.loading_history_lock_, IGNORE); - - CloseHandle(signon_lock_); - CloseHandle(avatar_lock_); - CloseHandle(log_lock_); - CloseHandle(update_loop_lock_); - CloseHandle(facy.send_message_lock_); - CloseHandle(facy.fcb_conn_lock_); - CloseHandle(facy.notifications_lock_); - CloseHandle(facy.cookies_lock_); - CloseHandle(facy.loading_history_lock_); + WaitForSingleObject(update_loop_event, INFINITE); + CloseHandle(update_loop_event); } ////////////////////////////////////////////////////////////////////////////// |