diff options
| author | Cory Fields <[email protected]> | 2016-12-31 02:05:21 -0500 |
|---|---|---|
| committer | Cory Fields <[email protected]> | 2017-01-12 23:05:09 -0500 |
| commit | ef7b5ecbb73e9fd3670494c99cfc13ccf3574170 (patch) | |
| tree | 9976c03d3c259e0b24a1313453b806c674049655 /src/net.cpp | |
| parent | net: record bytes written before notifying the message processor (diff) | |
| download | discoin-ef7b5ecbb73e9fd3670494c99cfc13ccf3574170.tar.xz discoin-ef7b5ecbb73e9fd3670494c99cfc13ccf3574170.zip | |
net: Add a simple function for waking the message handler
This may be used publicly in the future
Diffstat (limited to 'src/net.cpp')
| -rw-r--r-- | src/net.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/net.cpp b/src/net.cpp index 312a6e094..36db77abb 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -1239,8 +1239,8 @@ void CConnman::ThreadSocketHandler() if (!pnode->ReceiveMsgBytes(pchBuf, nBytes, notify)) pnode->CloseSocketDisconnect(); RecordBytesRecv(nBytes); - if(notify) - condMsgProc.notify_one(); + if (notify) + WakeMessageHandler(); } else if (nBytes == 0) { @@ -1315,8 +1315,10 @@ void CConnman::ThreadSocketHandler() } } - - +void CConnman::WakeMessageHandler() +{ + condMsgProc.notify_one(); +} |