MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / loopThread

Function loopThread

src/remote/server/server.cpp:6879–7084  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6877
6878
6879static THREAD_ENTRY_DECLARE loopThread(THREAD_ENTRY_PARAM)
6880{
6881/**************************************
6882 *
6883 * t h r e a d
6884 *
6885 **************************************
6886 *
6887 * Functional description
6888 * Execute requests in a happy loop.
6889 *
6890 **************************************/
6891
6892 try {
6893
6894 FpeControl::maskAll();
6895
6896 Worker worker;
6897
6898 while (!Worker::isShuttingDown())
6899 {
6900 MutexEnsureUnlock reqQueGuard(request_que_mutex, FB_FUNCTION);
6901 reqQueGuard.enter();
6902 server_req_t* request = request_que;
6903 if (request)
6904 {
6905 worker.setState(true);
6906
6907 REMOTE_TRACE(("Dequeue request %p", request_que));
6908 request_que = request->req_next;
6909 ports_pending--;
6910 reqQueGuard.leave();
6911
6912 while (request)
6913 {
6914 rem_port* port = NULL;
6915
6916 // Bind a thread to a port.
6917
6918 if (request->req_port->port_server_flags & SRVR_thread_per_port)
6919 {
6920 port = request->req_port;
6921 free_request(request);
6922
6923 SRVR_main(port, port->port_server_flags);
6924 request = 0;
6925 continue;
6926 }
6927 // Splice request into list of active requests, execute request,
6928 // and unsplice
6929
6930 { // scope
6931 MutexLockGuard queGuard(request_que_mutex, FB_FUNCTION);
6932 request->req_next = active_requests;
6933 active_requests = request;
6934 ports_active++;
6935 }
6936

Callers

nothing calls this directly

Calls 15

free_requestFunction · 0.85
SRVR_mainFunction · 0.85
process_packetFunction · 0.85
alloc_requestFunction · 0.85
link_requestFunction · 0.85
fflushFunction · 0.85
append_request_nextFunction · 0.85
iscLogExceptionFunction · 0.85
haveRecvDataMethod · 0.80
getRecvStateMethod · 0.80
setRecvStateMethod · 0.80
clearRecvQueMethod · 0.80

Tested by

no test coverage detected