![]() |
Bitcoin Core 31.1.0
P2P Digital Currency
|
Helps keep track of open evhttp_connections with active evhttp_requests. More...
Public Member Functions | |
| void | AddRequest (evhttp_request *req) EXCLUSIVE_LOCKS_REQUIRED(!m_mutex) |
| Increase request counter for the associated connection by 1. | |
| void | RemoveRequest (evhttp_request *req) EXCLUSIVE_LOCKS_REQUIRED(!m_mutex) |
| Decrease request counter for the associated connection by 1, remove connection if counter is 0. | |
| void | RemoveConnection (const evhttp_connection *conn) EXCLUSIVE_LOCKS_REQUIRED(!m_mutex) |
| Remove a connection entirely. | |
| size_t | CountActiveConnections () const EXCLUSIVE_LOCKS_REQUIRED(!m_mutex) |
| void | WaitUntilEmpty () const EXCLUSIVE_LOCKS_REQUIRED(!m_mutex) |
| Wait until there are no more connections with active requests in the tracker. | |
Private Member Functions | |
| std::unordered_map< const evhttp_connection *, size_t > m_tracker | GUARDED_BY (m_mutex) |
| For each connection, keep a counter of how many requests are open. | |
| void | RemoveConnectionInternal (const decltype(m_tracker)::iterator it) EXCLUSIVE_LOCKS_REQUIRED(m_mutex) |
Private Attributes | |
| Mutex | m_mutex |
| std::condition_variable | m_cv |
Helps keep track of open evhttp_connections with active evhttp_requests.
Definition at line 85 of file httpserver.cpp.
|
inline |
Increase request counter for the associated connection by 1.
Definition at line 100 of file httpserver.cpp.
|
inline |
Definition at line 122 of file httpserver.cpp.
|
private |
For each connection, keep a counter of how many requests are open.
|
inline |
Remove a connection entirely.
Definition at line 116 of file httpserver.cpp.
|
inlineprivate |
|
inline |
Decrease request counter for the associated connection by 1, remove connection if counter is 0.
Definition at line 106 of file httpserver.cpp.
|
inline |
Wait until there are no more connections with active requests in the tracker.
Definition at line 127 of file httpserver.cpp.
|
mutableprivate |
Definition at line 89 of file httpserver.cpp.
|
mutableprivate |
Definition at line 88 of file httpserver.cpp.