Fixed multithread sync issue and duplicate thread on termination.

This commit is contained in:
Brad Arant committed 2023-03-11 21:55:33 -08:00
1 parent b0118cfc56
commit cfa70c5863
72 files changed
+395 -427

No files matched your search

+2 -39
View File
@@ -35,19 +35,12 @@ bool \mbox{\hyperlink{classcore_1_1EPoll_a0c2865acd31d14fbf19dbc42cc084ddc}{stop
\begin{DoxyCompactList}\small\item\em Stop and shut down the BMAEPoll processing. \end{DoxyCompactList}\item
bool \mbox{\hyperlink{classcore_1_1EPoll_a301b46b71ac7ac61a687ff723fe269b3}{is\+Stopping}} ()
\begin{DoxyCompactList}\small\item\em Returns a true if the stop command has been requested. \end{DoxyCompactList}\item
bool \mbox{\hyperlink{classcore_1_1EPoll_a3d813c7bbf0da70ebc8e3cb6aeeacfb4}{register\+Socket}} (\mbox{\hyperlink{classcore_1_1Socket}{Socket}} $\ast$socket)
\begin{DoxyCompactList}\small\item\em Register a BMASocket for monitoring by BMAEPoll. \end{DoxyCompactList}\item
bool \mbox{\hyperlink{classcore_1_1EPoll_a5ab5e82ab51e0952fc8fbcc128f52900}{unregister\+Socket}} (\mbox{\hyperlink{classcore_1_1Socket}{Socket}} $\ast$socket)
\begin{DoxyCompactList}\small\item\em Unregister a BMASocket from monitoring by BMAEPoll. \end{DoxyCompactList}\item
int \mbox{\hyperlink{classcore_1_1EPoll_a1e52017e1deae15c1c87c6b6a099e1ed}{get\+Descriptor}} ()
\begin{DoxyCompactList}\small\item\em Return the descriptor for the e\+Poll socket. \end{DoxyCompactList}\item
void \mbox{\hyperlink{classcore_1_1EPoll_a3238b150b5d0a57eb2e1b17daa236d3b}{event\+Received}} (struct epoll\+\_\+event event)
\begin{DoxyCompactList}\small\item\em Dispatch event to appropriate socket. \end{DoxyCompactList}\item
int \mbox{\hyperlink{classcore_1_1EPoll_a22b5f1545aff3162040844be043abcce}{process\+Command}} (coreutils\+::\+ZString \&request, \mbox{\hyperlink{classcore_1_1TCPSession}{TCPSession}} \&session) override
\begin{DoxyCompactList}\small\item\em Output the threads array to the console. \end{DoxyCompactList}\item
\mbox{\Hypertarget{classcore_1_1EPoll_a033633714311f3edc4127ddd1c37f299}\label{classcore_1_1EPoll_a033633714311f3edc4127ddd1c37f299}}
void {\bfseries reset\+Socket} (\mbox{\hyperlink{classcore_1_1Socket}{Socket}} $\ast$socket)
\end{DoxyCompactItemize}
\begin{DoxyCompactList}\small\item\em Output the threads array to the console. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Public Attributes}
\begin{DoxyCompactItemize}
\item
@@ -138,26 +131,6 @@ The \mbox{\hyperlink{classcore_1_1EPoll_a22b5f1545aff3162040844be043abcce}{proce
Reimplemented from \mbox{\hyperlink{classcore_1_1Command_a95176f2532c38ee14e3fee40ee28b1bd}{core\+::\+Command}}.
\mbox{\Hypertarget{classcore_1_1EPoll_a3d813c7bbf0da70ebc8e3cb6aeeacfb4}\label{classcore_1_1EPoll_a3d813c7bbf0da70ebc8e3cb6aeeacfb4}}
\index{core::EPoll@{core::EPoll}!registerSocket@{registerSocket}}
\index{registerSocket@{registerSocket}!core::EPoll@{core::EPoll}}
\doxysubsubsection{\texorpdfstring{registerSocket()}{registerSocket()}}
{\footnotesize\ttfamily bool core\+::\+EPoll\+::register\+Socket (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{classcore_1_1Socket}{Socket}} $\ast$}]{socket }\end{DoxyParamCaption})}
Register a BMASocket for monitoring by BMAEPoll.
Use register\+Socket to add a new socket to the e\+Poll event watch list. This enables a new BMASocket object to receive events when data is received as well as to write data output to the socket.
\begin{DoxyParams}{Parameters}
{\em socket} & a pointer to a BMASocket object. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
a booelean that indicates the socket was registered or not.
\end{DoxyReturn}
\mbox{\Hypertarget{classcore_1_1EPoll_aaefe2caef75eb538af90cb34682d277b}\label{classcore_1_1EPoll_aaefe2caef75eb538af90cb34682d277b}}
\index{core::EPoll@{core::EPoll}!start@{start}}
\index{start@{start}!core::EPoll@{core::EPoll}}
@@ -189,17 +162,7 @@ Stop and shut down the BMAEPoll processing.
Use the \mbox{\hyperlink{classcore_1_1EPoll_a0c2865acd31d14fbf19dbc42cc084ddc}{stop()}} method to initiate the shutdown process for the epoll socket management.
A complete shutdown of all managed sockets will be initiated by this method call. \mbox{\Hypertarget{classcore_1_1EPoll_a5ab5e82ab51e0952fc8fbcc128f52900}\label{classcore_1_1EPoll_a5ab5e82ab51e0952fc8fbcc128f52900}}
\index{core::EPoll@{core::EPoll}!unregisterSocket@{unregisterSocket}}
\index{unregisterSocket@{unregisterSocket}!core::EPoll@{core::EPoll}}
\doxysubsubsection{\texorpdfstring{unregisterSocket()}{unregisterSocket()}}
{\footnotesize\ttfamily bool core\+::\+EPoll\+::unregister\+Socket (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{classcore_1_1Socket}{Socket}} $\ast$}]{socket }\end{DoxyParamCaption})}
Unregister a BMASocket from monitoring by BMAEPoll.
Use this method to remove a socket from receiving events from the epoll system.
A complete shutdown of all managed sockets will be initiated by this method call.
\doxysubsection{Member Data Documentation}
\mbox{\Hypertarget{classcore_1_1EPoll_acfcef2513d94f7b9a191fed3dc744d90}\label{classcore_1_1EPoll_acfcef2513d94f7b9a191fed3dc744d90}}
+6
View File
@@ -58,6 +58,12 @@ virtual void \mbox{\hyperlink{classcore_1_1Socket_ae9be59697c2b2e5efb19aaae3ba94
\begin{DoxyCompactList}\small\item\em Called when the socket has finished unregistering for the epoll processing. \end{DoxyCompactList}\item
\mbox{\Hypertarget{classcore_1_1Socket_a43247bfe43c2be5ab3863d9057d46b7c}\label{classcore_1_1Socket_a43247bfe43c2be5ab3863d9057d46b7c}}
bool {\bfseries needs\+To\+Write} ()
\item
\mbox{\Hypertarget{classcore_1_1Socket_a04a41baed2feb95cab02d6e61d4f33ce}\label{classcore_1_1Socket_a04a41baed2feb95cab02d6e61d4f33ce}}
void {\bfseries enable\+Socket} ()
\item
\mbox{\Hypertarget{classcore_1_1Socket_a2ff4d1d1240f8a51cf19d620b4f51f20}\label{classcore_1_1Socket_a2ff4d1d1240f8a51cf19d620b4f51f20}}
void {\bfseries disable\+Socket} ()
\end{DoxyCompactItemize}
\doxysubsection*{Public Attributes}
\begin{DoxyCompactItemize}