summaryrefslogtreecommitdiff
path: root/protocols/FacebookRM/src/connection.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-01-04 21:02:56 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-01-04 21:02:56 +0300
commit1b89cbba1f3bc00ea24a8414b2e670c582ac5fc4 (patch)
tree76ac43351cbbdbece75774d6f7bbf1e89b6cdca8 /protocols/FacebookRM/src/connection.cpp
parent5b32a855e518f67589fd49837795a605a19badce (diff)
Facebook: switch to mir_cs instead of custom lock
Diffstat (limited to 'protocols/FacebookRM/src/connection.cpp')
-rw-r--r--protocols/FacebookRM/src/connection.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/protocols/FacebookRM/src/connection.cpp b/protocols/FacebookRM/src/connection.cpp
index 801e091a90..b99ab28544 100644
--- a/protocols/FacebookRM/src/connection.cpp
+++ b/protocols/FacebookRM/src/connection.cpp
@@ -24,7 +24,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
void FacebookProto::ChangeStatus(void*)
{
- ScopedLock s(signon_lock_);
+ mir_cslock s(signon_lock_);
int new_status = m_iDesiredStatus;
int old_status = m_iStatus;
@@ -34,7 +34,7 @@ void FacebookProto::ChangeStatus(void*)
debugLogA("### Beginning SignOff process");
m_signingOut = true;
- SetEvent(update_loop_lock_);
+ SetEvent(update_loop_event);
// Shutdown and close channel handle
Netlib_Shutdown(facy.hChannelCon);
@@ -84,7 +84,6 @@ void FacebookProto::ChangeStatus(void*)
m_signingOut = false;
debugLogA("### SignOff complete");
-
return;
}
else if (old_status == ID_STATUS_OFFLINE) {
@@ -100,7 +99,7 @@ void FacebookProto::ChangeStatus(void*)
m_iStatus = facy.self_.status_id = ID_STATUS_CONNECTING;
ProtoBroadcastAck(0, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)old_status, m_iStatus);
- ResetEvent(update_loop_lock_);
+ ResetEvent(update_loop_event);
// Workaround for not working "mbasic." for some users - reset this flag at every login
facy.mbasicWorks = true;
@@ -227,12 +226,12 @@ void FacebookProto::UpdateLoop(void *)
ProcessFeeds(nullptr);
debugLogA("*** FacebookProto::UpdateLoop[%d] going to sleep...", tim);
- if (WaitForSingleObjectEx(update_loop_lock_, GetPollRate() * 1000, true) != WAIT_TIMEOUT)
+ if (WaitForSingleObjectEx(update_loop_event, GetPollRate() * 1000, true) != WAIT_TIMEOUT)
break;
debugLogA("*** FacebookProto::UpdateLoop[%d] waking up...", tim);
}
- ResetEvent(update_loop_lock_);
+ ResetEvent(update_loop_event);
debugLogA("<<< Exiting FacebookProto::UpdateLoop[%d]", tim);
}