\hypertarget{group__threading__functions}{}\doxysection{Threading Functions} \label{group__threading__functions}\index{Threading Functions@{Threading Functions}} \doxysubsection*{Functions} \begin{DoxyCompactItemize} \item nothing \mbox{\hyperlink{group__threading__functions_ga67572bb3364b4af9d37226948fb680c5}{Qore\+::delete\+\_\+all\+\_\+thread\+\_\+data}} () \begin{DoxyCompactList}\small\item\em Deletes all keys in the thread-\/local data hash. \end{DoxyCompactList}\item nothing \mbox{\hyperlink{group__threading__functions_ga7fecb4c50726c994a9cdaf1d3284e5b4}{Qore\+::delete\+\_\+thread\+\_\+data}} (...) \begin{DoxyCompactList}\small\item\em Deletes the data associated to one or more keys in the thread-\/local data hash; if the data is an object, then it is destroyed. \end{DoxyCompactList}\item nothing \mbox{\hyperlink{group__threading__functions_ga13a50ab4c054ee3f48afaa72c55f22e0}{Qore\+::delete\+\_\+thread\+\_\+data}} (\mbox{\hyperlink{group__type__conversion__functions_ga4b52a1cbee7a3aed46c32cb0a938629c}{list}}$<$ softstring $>$ l) \begin{DoxyCompactList}\small\item\em Deletes the data associated to one or more keys in the thread-\/local data hash; if the data is an object, then it is destroyed. \end{DoxyCompactList}\item \mbox{\hyperlink{group__type__conversion__functions_ga0231dbb472dd230310af7c7c34f56e92}{hash}}$<$ \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}, \mbox{\hyperlink{group__type__conversion__functions_ga4b52a1cbee7a3aed46c32cb0a938629c}{list}}$<$ \mbox{\hyperlink{group__type__conversion__functions_ga0231dbb472dd230310af7c7c34f56e92}{hash}}$<$ \mbox{\hyperlink{struct_qore_1_1_call_stack_info}{Call\+Stack\+Info}} $>$ $>$ $>$ \mbox{\hyperlink{group__threading__functions_ga52baa4131379e22e307ae742ffbe3ee1}{Qore\+::get\+All\+Thread\+Call\+Stacks}} () \begin{DoxyCompactList}\small\item\em Returns a hash of lists of \mbox{\hyperlink{struct_qore_1_1_call_stack_info}{Call\+Stack\+Info}} hashes keyed by TID (thread ID) \end{DoxyCompactList}\item \mbox{\hyperlink{group__type__conversion__functions_ga0231dbb472dd230310af7c7c34f56e92}{hash}}$<$ \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}, \mbox{\hyperlink{group__type__conversion__functions_ga4b52a1cbee7a3aed46c32cb0a938629c}{list}}$<$ \mbox{\hyperlink{group__type__conversion__functions_ga0231dbb472dd230310af7c7c34f56e92}{hash}}$<$ \mbox{\hyperlink{struct_qore_1_1_call_stack_info}{Call\+Stack\+Info}} $>$ $>$ $>$ \mbox{\hyperlink{group__threading__functions_gae4d42c6ab7b7fc7d9a9cb1be139f6773}{Qore\+::get\+\_\+all\+\_\+thread\+\_\+call\+\_\+stacks}} () \begin{DoxyCompactList}\small\item\em Returns a hash of lists of \mbox{\hyperlink{struct_qore_1_1_call_stack_info}{Call\+Stack\+Info}} hashes keyed by TID (thread ID) \end{DoxyCompactList}\item \mbox{\hyperlink{group__type__conversion__functions_ga0231dbb472dd230310af7c7c34f56e92}{hash}}$<$ auto $>$ \mbox{\hyperlink{group__threading__functions_ga648b002d4fc96c5cfa78ba558b3d5538}{Qore\+::get\+\_\+all\+\_\+thread\+\_\+data}} () \begin{DoxyCompactList}\small\item\em Returns the entire thread-\/local data hash. \end{DoxyCompactList}\item \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} \mbox{\hyperlink{group__threading__functions_ga82d1b72e32a368be71b3b91462cbe0da}{Qore\+::get\+\_\+default\+\_\+thread\+\_\+stack\+\_\+size}} () \begin{DoxyCompactList}\small\item\em returns the default thread stack size \end{DoxyCompactList}\item \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} \mbox{\hyperlink{group__threading__functions_gaa97833f603fb51b23fe0bb6c22b7f95f}{Qore\+::get\+\_\+stack\+\_\+size}} () \begin{DoxyCompactList}\small\item\em returns the current thread\textquotesingle{}s stack size \end{DoxyCompactList}\item \mbox{\hyperlink{group__type__conversion__functions_ga4b52a1cbee7a3aed46c32cb0a938629c}{list}}$<$ \mbox{\hyperlink{group__type__conversion__functions_ga0231dbb472dd230310af7c7c34f56e92}{hash}}$<$ \mbox{\hyperlink{struct_qore_1_1_call_stack_info}{Call\+Stack\+Info}} $>$ $>$ \mbox{\hyperlink{group__threading__functions_gaff3b8af236d59870ff5c6a36c17c4907}{Qore\+::get\+\_\+thread\+\_\+call\+\_\+stack}} () \begin{DoxyCompactList}\small\item\em Returns a list of \mbox{\hyperlink{struct_qore_1_1_call_stack_info}{Call\+Stack\+Info}} hashes for the current TID (thread ID); because it is always from the same thread being read, no locking is applied as in \mbox{\hyperlink{group__threading__functions_gae4d42c6ab7b7fc7d9a9cb1be139f6773}{get\+\_\+all\+\_\+thread\+\_\+call\+\_\+stacks()}} \end{DoxyCompactList}\item auto \mbox{\hyperlink{group__threading__functions_ga1bf3fa656c5e803e9453a5ed84fd556c}{Qore\+::get\+\_\+thread\+\_\+data}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} key) \begin{DoxyCompactList}\small\item\em Returns the value of the thread-\/local data attached to the key passed. \end{DoxyCompactList}\item nothing \mbox{\hyperlink{group__threading__functions_gafe320b93634b056e4d36ad02086b0638}{Qore\+::get\+\_\+thread\+\_\+data}} () \begin{DoxyCompactList}\small\item\em This function variant does nothing at all; it is only included for backwards-\/compatibility with qore prior to version 0.\+8.\+0 for functions that would ignore type errors in arguments. \end{DoxyCompactList}\item \+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{group__threading__functions_ga79f9cd8de9606cae29c29e3b08d234f0}{Qore\+::get\+\_\+thread\+\_\+name}} () \begin{DoxyCompactList}\small\item\em returns the current thread\textquotesingle{}s descriptive name if set or \mbox{\hyperlink{basic_data_types_nothing}{NOTHING}} if not \end{DoxyCompactList}\item \+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{class_qore_1_1_time_zone}{Time\+Zone}} \mbox{\hyperlink{group__threading__functions_gad86831d8ae7b5b1d35e9bb14dc9f6325}{Qore\+::get\+\_\+thread\+\_\+tz}} () \begin{DoxyCompactList}\small\item\em Returns any \mbox{\hyperlink{class_qore_1_1_time_zone}{Time\+Zone}} set for the current thread, \mbox{\hyperlink{basic_data_types_nothing}{NOTHING}} if none is set. \end{DoxyCompactList}\item \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} \mbox{\hyperlink{group__threading__functions_ga95ed8e572309b44b3f5b49673238c3e6}{Qore\+::gettid}} () \begin{DoxyCompactList}\small\item\em Returns the Qore thread ID (TID) of the current thread. \end{DoxyCompactList}\item nothing \mbox{\hyperlink{group__threading__functions_gafa1c0f9e429a945b66fb261c7fa1b5bd}{Qore\+::mark\+\_\+thread\+\_\+resources}} () \begin{DoxyCompactList}\small\item\em Marks thread resources so that any thread resources left allocated after this call will be cleaned up when \mbox{\hyperlink{group__threading__functions_ga4e62409b8a1b414276d033267e7299e4}{throw\+\_\+thread\+\_\+resource\+\_\+exceptions\+\_\+to\+\_\+mark()}} is called. \end{DoxyCompactList}\item \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} \mbox{\hyperlink{group__threading__functions_ga4bffba0876346fe5233ed4f5161c90d0}{Qore\+::num\+\_\+threads}} () \begin{DoxyCompactList}\small\item\em Returns the current number of threads in the process (not including the special \mbox{\hyperlink{signal_handling}{signal handling thread}}) \end{DoxyCompactList}\item \+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_ga0231dbb472dd230310af7c7c34f56e92}{hash}}$<$ auto $>$ \mbox{\hyperlink{group__threading__functions_ga33a9531a01ae17fc2560f95c0b2039be}{Qore\+::remove\+\_\+thread\+\_\+data}} (...) \begin{DoxyCompactList}\small\item\em Removes the data associated to one or more keys in the thread-\/local data hash and returns the data removed. \end{DoxyCompactList}\item \mbox{\hyperlink{group__type__conversion__functions_ga0231dbb472dd230310af7c7c34f56e92}{hash}}$<$ auto $>$ \mbox{\hyperlink{group__threading__functions_ga13a9048eefe3d5cd6398f29e2b5bb05a}{Qore\+::remove\+\_\+thread\+\_\+data}} (\mbox{\hyperlink{group__type__conversion__functions_ga4b52a1cbee7a3aed46c32cb0a938629c}{list}}$<$ softstring $>$ l) \begin{DoxyCompactList}\small\item\em Removes the data associated to one or more keys in the thread-\/local data hash from a literal list passed as the first argument and returns the data removed. \end{DoxyCompactList}\item bool \mbox{\hyperlink{group__threading__functions_gadc994316e54fdf50111018de9bd15dc6}{Qore\+::remove\+\_\+thread\+\_\+resource}} (Abstract\+Thread\+Resource resource) \begin{DoxyCompactList}\small\item\em removes a thread resource from the current thread \end{DoxyCompactList}\item bool \mbox{\hyperlink{group__threading__functions_gac1735e87940d93e2614485c050217ac5}{Qore\+::remove\+\_\+thread\+\_\+resource}} (code resource) \begin{DoxyCompactList}\small\item\em removes a callable thread resource from the current thread \end{DoxyCompactList}\item nothing \mbox{\hyperlink{group__threading__functions_ga496d14c02dcc992bf82fefbfe6a0d1ca}{Qore\+::save\+\_\+thread\+\_\+data}} (\mbox{\hyperlink{group__type__conversion__functions_ga0231dbb472dd230310af7c7c34f56e92}{hash}}$<$ auto $>$ h) \begin{DoxyCompactList}\small\item\em Saves the data passed in the thread-\/local hash; all keys are merged into the thread-\/local hash, overwriting any information that may have been there before. \end{DoxyCompactList}\item nothing \mbox{\hyperlink{group__threading__functions_ga19470247ebe21daddfae06b2e98238b5}{Qore\+::save\+\_\+thread\+\_\+data}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} key, auto value) \begin{DoxyCompactList}\small\item\em Saves the data passed against the key passed as an argument in thread-\/local storage. \end{DoxyCompactList}\item nothing \mbox{\hyperlink{group__threading__functions_ga1da332e389e3083ba80d45aaec0525c6}{Qore\+::save\+\_\+thread\+\_\+data}} () \begin{DoxyCompactList}\small\item\em This function variant does nothing at all; it is only included for backwards-\/compatibility with qore prior to version 0.\+8.\+0 for functions that would ignore type errors in arguments. \end{DoxyCompactList}\item \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} \mbox{\hyperlink{group__threading__functions_gadbd86685c49fd7b4960b8b21e05cb2f0}{Qore\+::set\+\_\+default\+\_\+thread\+\_\+stack\+\_\+size}} (\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} size) \begin{DoxyCompactList}\small\item\em sets the default thread stack size for new threads created after this call and returns the stack size actually set \end{DoxyCompactList}\item bool \mbox{\hyperlink{group__threading__functions_gae83c32576b59a1ecfa906d9b3c3af557}{Qore\+::set\+\_\+thread\+\_\+init}} (\+\_\+\+\_\+7\+\_\+ code init) \begin{DoxyCompactList}\small\item\em Sets a \mbox{\hyperlink{expressions_call_reference}{call reference}} or \mbox{\hyperlink{expressions_closure}{closure}} to run every time a new thread is started. \end{DoxyCompactList}\item nothing \mbox{\hyperlink{group__threading__functions_ga321040a3e764383dd68c50d496436e87}{Qore\+::set\+\_\+thread\+\_\+name}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} name) \begin{DoxyCompactList}\small\item\em sets the current thread\textquotesingle{}s descriptive name \end{DoxyCompactList}\item nothing \mbox{\hyperlink{group__threading__functions_ga1a1fbc371cfc8885ed78e4bff25d35b1}{Qore\+::set\+\_\+thread\+\_\+resource}} (Abstract\+Thread\+Resource resource) \begin{DoxyCompactList}\small\item\em sets a thread resource for the current thread \end{DoxyCompactList}\item nothing \mbox{\hyperlink{group__threading__functions_ga2ef317e679a8362978e08c8ad3368014}{Qore\+::set\+\_\+thread\+\_\+resource}} (code resource, auto arg) \begin{DoxyCompactList}\small\item\em sets a callable thread resource for the current thread with an optional argument \end{DoxyCompactList}\item nothing \mbox{\hyperlink{group__threading__functions_ga07fcdce92cacc7cea4b92504a737d7c2}{Qore\+::set\+\_\+thread\+\_\+tz}} (\mbox{\hyperlink{class_qore_1_1_time_zone}{Time\+Zone}} zone) \begin{DoxyCompactList}\small\item\em Sets the default time zone for the current thread. \end{DoxyCompactList}\item nothing \mbox{\hyperlink{group__threading__functions_ga21c1462b384cf6a52d20195bb3b6cf90}{Qore\+::set\+\_\+thread\+\_\+tz}} () \begin{DoxyCompactList}\small\item\em Clears the thread-\/local time zone for the current thread; after this call \mbox{\hyperlink{class_qore_1_1_time_zone_a71965bdd73c4d8da8f5bb72d54606ccf}{Time\+Zone\+::get()}} will return the value set for the current \mbox{\hyperlink{class_qore_1_1_program}{Program}}. \end{DoxyCompactList}\item \mbox{\hyperlink{group__type__conversion__functions_ga4b52a1cbee7a3aed46c32cb0a938629c}{list}}$<$ \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} $>$ \mbox{\hyperlink{group__threading__functions_ga113081673d536fc7bae33d2ffe523893}{Qore\+::thread\+\_\+list}} () \begin{DoxyCompactList}\small\item\em Returns a list of all current thread IDs. \end{DoxyCompactList}\item nothing \mbox{\hyperlink{group__threading__functions_ga23d27aeac0640b070f964f2eb9f1cc8a}{Qore\+::thread\+\_\+yield}} () \begin{DoxyCompactList}\small\item\em yields the current thread so other threads can be scheduled and run \end{DoxyCompactList}\item nothing \mbox{\hyperlink{group__threading__functions_ga401f0e787e79f2e4851d60b9223bb8d2}{Qore\+::throw\+Thread\+Resource\+Exceptions}} () \begin{DoxyCompactList}\small\item\em Immediately runs all thread resource cleanup routines for the current thread and throws all associated exceptions. \end{DoxyCompactList}\item nothing \mbox{\hyperlink{group__threading__functions_ga421dca39ccb55b191d5d09fd98c2075a}{Qore\+::throw\+\_\+thread\+\_\+resource\+\_\+exceptions}} () \begin{DoxyCompactList}\small\item\em Immediately runs all thread resource cleanup routines for the current thread and throws all associated exceptions. \end{DoxyCompactList}\item bool \mbox{\hyperlink{group__threading__functions_ga4e62409b8a1b414276d033267e7299e4}{Qore\+::throw\+\_\+thread\+\_\+resource\+\_\+exceptions\+\_\+to\+\_\+mark}} () \begin{DoxyCompactList}\small\item\em Immediately runs all thread resource cleanup routines for the current thread for thread resources created since the last call to \mbox{\hyperlink{group__threading__functions_gafa1c0f9e429a945b66fb261c7fa1b5bd}{mark\+\_\+thread\+\_\+resources()}} and throws all associated exceptions. \end{DoxyCompactList}\end{DoxyCompactItemize} \doxysubsection{Detailed Description} Threading functions \doxysubsection{Function Documentation} \mbox{\Hypertarget{group__threading__functions_ga67572bb3364b4af9d37226948fb680c5}\label{group__threading__functions_ga67572bb3364b4af9d37226948fb680c5}} \index{Threading Functions@{Threading Functions}!delete\_all\_thread\_data@{delete\_all\_thread\_data}} \index{delete\_all\_thread\_data@{delete\_all\_thread\_data}!Threading Functions@{Threading Functions}} \doxysubsubsection{\texorpdfstring{delete\_all\_thread\_data()}{delete\_all\_thread\_data()}} {\footnotesize\ttfamily nothing Qore\+::delete\+\_\+all\+\_\+thread\+\_\+data (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})} Deletes all keys in the thread-\/local data hash. \begin{DoxyParagraph}{Restrictions\+:} \mbox{\hyperlink{group__parse__options_ga16d8c2b85171b6673b60b5f7d0eaf5eb}{Qore\+::\+PO\+\_\+\+NO\+\_\+\+THREAD\+\_\+\+CONTROL}} \end{DoxyParagraph} \begin{DoxyParagraph}{Example\+:} \begin{DoxyCode}{0} \DoxyCodeLine{\mbox{\hyperlink{group__threading__functions_ga67572bb3364b4af9d37226948fb680c5}{delete\_all\_thread\_data}}();} \end{DoxyCode} \end{DoxyParagraph} \begin{DoxyNote}{Note} This function does not throw any exceptions, however if an object is deleted from the thread-\/local data hash, then it could throw an exception in its destructor \end{DoxyNote} \mbox{\Hypertarget{group__threading__functions_ga7fecb4c50726c994a9cdaf1d3284e5b4}\label{group__threading__functions_ga7fecb4c50726c994a9cdaf1d3284e5b4}} \index{Threading Functions@{Threading Functions}!delete\_thread\_data@{delete\_thread\_data}} \index{delete\_thread\_data@{delete\_thread\_data}!Threading Functions@{Threading Functions}} \doxysubsubsection{\texorpdfstring{delete\_thread\_data()}{delete\_thread\_data()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}} {\footnotesize\ttfamily nothing Qore\+::delete\+\_\+thread\+\_\+data (\begin{DoxyParamCaption}\item[{}]{... }\end{DoxyParamCaption})} Deletes the data associated to one or more keys in the thread-\/local data hash; if the data is an object, then it is destroyed. \begin{DoxyParagraph}{Restrictions\+:} \mbox{\hyperlink{group__parse__options_ga16d8c2b85171b6673b60b5f7d0eaf5eb}{Qore\+::\+PO\+\_\+\+NO\+\_\+\+THREAD\+\_\+\+CONTROL}} \end{DoxyParagraph} \begin{DoxyParams}{Parameters} {\em ...} & Deletes the data associated to one or more keys in the thread-\/local data hash corresponding to each string argument in the top-\/level argument list; arguments are converted to strings if necessary\\ \hline \end{DoxyParams} \begin{DoxyParagraph}{Example\+:} \begin{DoxyCode}{0} \DoxyCodeLine{\mbox{\hyperlink{group__threading__functions_ga7fecb4c50726c994a9cdaf1d3284e5b4}{delete\_thread\_data}}(\textcolor{stringliteral}{"{}key1"{}}, \textcolor{stringliteral}{"{}key2"{}});} \end{DoxyCode} \end{DoxyParagraph} \begin{DoxyNote}{Note} This function does not throw any exceptions, however if an object is deleted from the thread-\/local data hash, then it could throw an exception in its destructor \end{DoxyNote} \begin{DoxySeeAlso}{See also} \mbox{\hyperlink{group__threading__functions_ga33a9531a01ae17fc2560f95c0b2039be}{remove\+\_\+thread\+\_\+data()}} for a similar function that does not explicitly destroy objects in the thread-\/local data \mbox{\hyperlink{group__type__conversion__functions_ga0231dbb472dd230310af7c7c34f56e92}{hash}} \end{DoxySeeAlso} \mbox{\Hypertarget{group__threading__functions_ga13a50ab4c054ee3f48afaa72c55f22e0}\label{group__threading__functions_ga13a50ab4c054ee3f48afaa72c55f22e0}} \index{Threading Functions@{Threading Functions}!delete\_thread\_data@{delete\_thread\_data}} \index{delete\_thread\_data@{delete\_thread\_data}!Threading Functions@{Threading Functions}} \doxysubsubsection{\texorpdfstring{delete\_thread\_data()}{delete\_thread\_data()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}} {\footnotesize\ttfamily nothing Qore\+::delete\+\_\+thread\+\_\+data (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_ga4b52a1cbee7a3aed46c32cb0a938629c}{list}}$<$ softstring $>$}]{l }\end{DoxyParamCaption})} Deletes the data associated to one or more keys in the thread-\/local data hash; if the data is an object, then it is destroyed. \begin{DoxyParagraph}{Restrictions\+:} \mbox{\hyperlink{group__parse__options_ga16d8c2b85171b6673b60b5f7d0eaf5eb}{Qore\+::\+PO\+\_\+\+NO\+\_\+\+THREAD\+\_\+\+CONTROL}} \end{DoxyParagraph} \begin{DoxyParams}{Parameters} {\em l} & a list of key names for deleting keys in the thread-\/local data hash; values are converted to strings if necessary\\ \hline \end{DoxyParams} \begin{DoxyParagraph}{Example\+:} \begin{DoxyCode}{0} \DoxyCodeLine{\mbox{\hyperlink{group__threading__functions_ga7fecb4c50726c994a9cdaf1d3284e5b4}{delete\_thread\_data}}(list\_of\_keys);} \end{DoxyCode} \end{DoxyParagraph} \begin{DoxyNote}{Note} This function does not throw any exceptions, however if an object is deleted from the thread-\/local data hash, then it could throw an exception in its destructor \end{DoxyNote} \begin{DoxySeeAlso}{See also} \mbox{\hyperlink{group__threading__functions_ga33a9531a01ae17fc2560f95c0b2039be}{remove\+\_\+thread\+\_\+data()}} for a similar function that does not explicitly destroy objects in the thread-\/local data \mbox{\hyperlink{group__type__conversion__functions_ga0231dbb472dd230310af7c7c34f56e92}{hash}} \end{DoxySeeAlso} \mbox{\Hypertarget{group__threading__functions_gae4d42c6ab7b7fc7d9a9cb1be139f6773}\label{group__threading__functions_gae4d42c6ab7b7fc7d9a9cb1be139f6773}} \index{Threading Functions@{Threading Functions}!get\_all\_thread\_call\_stacks@{get\_all\_thread\_call\_stacks}} \index{get\_all\_thread\_call\_stacks@{get\_all\_thread\_call\_stacks}!Threading Functions@{Threading Functions}} \doxysubsubsection{\texorpdfstring{get\_all\_thread\_call\_stacks()}{get\_all\_thread\_call\_stacks()}} {\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga0231dbb472dd230310af7c7c34f56e92}{hash}}$<$\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}},\mbox{\hyperlink{group__type__conversion__functions_ga4b52a1cbee7a3aed46c32cb0a938629c}{list}}$<$\mbox{\hyperlink{group__type__conversion__functions_ga0231dbb472dd230310af7c7c34f56e92}{hash}}$<$\mbox{\hyperlink{struct_qore_1_1_call_stack_info}{Call\+Stack\+Info}}$>$ $>$ $>$ Qore\+::get\+\_\+all\+\_\+thread\+\_\+call\+\_\+stacks (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})} Returns a hash of lists of \mbox{\hyperlink{struct_qore_1_1_call_stack_info}{Call\+Stack\+Info}} hashes keyed by TID (thread ID) \begin{DoxyReturn}{Returns} a hash of lists of \mbox{\hyperlink{struct_qore_1_1_call_stack_info}{Call\+Stack\+Info}} hashes keyed by TID (thread ID) \end{DoxyReturn} \begin{DoxyParagraph}{Restrictions\+:} \mbox{\hyperlink{group__parse__options_ga16d8c2b85171b6673b60b5f7d0eaf5eb}{Qore\+::\+PO\+\_\+\+NO\+\_\+\+THREAD\+\_\+\+CONTROL}}, \mbox{\hyperlink{group__parse__options_gac379d98e62c57231c2efb7ea87c75a3a}{Qore\+::\+PO\+\_\+\+NO\+\_\+\+THREAD\+\_\+\+INFO}} \end{DoxyParagraph} \begin{DoxyParagraph}{Example\+:} \begin{DoxyCode}{0} \DoxyCodeLine{hash>> cs = \mbox{\hyperlink{group__threading__functions_gae4d42c6ab7b7fc7d9a9cb1be139f6773}{get\_all\_thread\_call\_stacks}}();} \DoxyCodeLine{foreach string tid \textcolor{keywordflow}{in} (cs.keyIterator()) \{} \DoxyCodeLine{ \mbox{\hyperlink{group__string__functions_ga32070517a9f8a70a32ef48f83a6f128e}{printf}}(\textcolor{stringliteral}{"{}TID \%d\(\backslash\)n"{}}, tid);} \DoxyCodeLine{ int i;} \DoxyCodeLine{ foreach hash l \textcolor{keywordflow}{in} (cs\{tid\}) \{} \DoxyCodeLine{ \textcolor{keywordflow}{if} (l.type != \textcolor{stringliteral}{"{}new-\/thread"{}}) \{} \DoxyCodeLine{ \mbox{\hyperlink{group__string__functions_ga32070517a9f8a70a32ef48f83a6f128e}{printf}}(\textcolor{stringliteral}{"{} \%d: \%s() called at \%s:\%d (\%s function)\(\backslash\)n"{}}, ++i, l.function, l.file, l.line, l.type);} \DoxyCodeLine{ \} \textcolor{keywordflow}{else} \{} \DoxyCodeLine{ \mbox{\hyperlink{group__string__functions_ga32070517a9f8a70a32ef48f83a6f128e}{printf}}(\textcolor{stringliteral}{"{} \%d: *** thread started by background operator ***\(\backslash\)n"{}}, ++i);} \DoxyCodeLine{ \}} \DoxyCodeLine{ \}} \DoxyCodeLine{\}} \end{DoxyCode} \end{DoxyParagraph} \begin{DoxySince}{Since} Qore 0.\+8.\+12 as a replacement for deprecated camel-\/case \mbox{\hyperlink{group__threading__functions_ga52baa4131379e22e307ae742ffbe3ee1}{get\+All\+Thread\+Call\+Stacks()}} \end{DoxySince} \mbox{\Hypertarget{group__threading__functions_ga648b002d4fc96c5cfa78ba558b3d5538}\label{group__threading__functions_ga648b002d4fc96c5cfa78ba558b3d5538}} \index{Threading Functions@{Threading Functions}!get\_all\_thread\_data@{get\_all\_thread\_data}} \index{get\_all\_thread\_data@{get\_all\_thread\_data}!Threading Functions@{Threading Functions}} \doxysubsubsection{\texorpdfstring{get\_all\_thread\_data()}{get\_all\_thread\_data()}} {\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga0231dbb472dd230310af7c7c34f56e92}{hash}}$<$auto$>$ Qore\+::get\+\_\+all\+\_\+thread\+\_\+data (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})} Returns the entire thread-\/local data hash. \begin{DoxyReturn}{Returns} the entire thread-\/local data hash \end{DoxyReturn} \begin{DoxyParagraph}{Restrictions\+:} \mbox{\hyperlink{group__parse__options_ga16d8c2b85171b6673b60b5f7d0eaf5eb}{Qore\+::\+PO\+\_\+\+NO\+\_\+\+THREAD\+\_\+\+CONTROL}}, \mbox{\hyperlink{group__parse__options_gac379d98e62c57231c2efb7ea87c75a3a}{Qore\+::\+PO\+\_\+\+NO\+\_\+\+THREAD\+\_\+\+INFO}} \end{DoxyParagraph} \begin{DoxyParagraph}{Code Flags\+:} \mbox{\hyperlink{code_flags_RET_VALUE_ONLY}{RET\+\_\+\+VALUE\+\_\+\+ONLY}} \end{DoxyParagraph} \begin{DoxyParagraph}{Example\+:} \begin{DoxyCode}{0} \DoxyCodeLine{hash th = \mbox{\hyperlink{group__threading__functions_ga648b002d4fc96c5cfa78ba558b3d5538}{get\_all\_thread\_data}}();} \end{DoxyCode} \end{DoxyParagraph} \begin{DoxyNote}{Note} this function is not flagged with \mbox{\hyperlink{code_flags_CONSTANT}{CONSTANT}} since its value could change at runtime \end{DoxyNote} \mbox{\Hypertarget{group__threading__functions_ga82d1b72e32a368be71b3b91462cbe0da}\label{group__threading__functions_ga82d1b72e32a368be71b3b91462cbe0da}} \index{Threading Functions@{Threading Functions}!get\_default\_thread\_stack\_size@{get\_default\_thread\_stack\_size}} \index{get\_default\_thread\_stack\_size@{get\_default\_thread\_stack\_size}!Threading Functions@{Threading Functions}} \doxysubsubsection{\texorpdfstring{get\_default\_thread\_stack\_size()}{get\_default\_thread\_stack\_size()}} {\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} Qore\+::get\+\_\+default\+\_\+thread\+\_\+stack\+\_\+size (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})} returns the default thread stack size \begin{DoxyParagraph}{Platform Availability\+:} \mbox{\hyperlink{group__option__constants_ga3e3b196e3ae7f8b26e890ce36c120901}{Qore\+::\+Option\+::\+HAVE\+\_\+\+MANAGE\+\_\+\+STACK}} \end{DoxyParagraph} \begin{DoxyParagraph}{Restrictions\+:} \mbox{\hyperlink{group__parse__options_gac379d98e62c57231c2efb7ea87c75a3a}{Qore\+::\+PO\+\_\+\+NO\+\_\+\+THREAD\+\_\+\+INFO}} \end{DoxyParagraph} \begin{DoxyParagraph}{Code Flags\+:} \mbox{\hyperlink{code_flags_CONSTANT}{CONSTANT}} \end{DoxyParagraph} \begin{DoxyParagraph}{Example\+:} \begin{DoxyCode}{0} \DoxyCodeLine{int size = \mbox{\hyperlink{group__threading__functions_ga82d1b72e32a368be71b3b91462cbe0da}{get\_default\_thread\_stack\_size}}();} \end{DoxyCode} \end{DoxyParagraph} \begin{DoxyNote}{Note} if the thread stack size has been changed since this thread was started, then the value returned by this function will not match the current thread\textquotesingle{}s stack size \end{DoxyNote} \begin{DoxySince}{Since} Qore 0.\+9.\+0 \end{DoxySince} \mbox{\Hypertarget{group__threading__functions_gaa97833f603fb51b23fe0bb6c22b7f95f}\label{group__threading__functions_gaa97833f603fb51b23fe0bb6c22b7f95f}} \index{Threading Functions@{Threading Functions}!get\_stack\_size@{get\_stack\_size}} \index{get\_stack\_size@{get\_stack\_size}!Threading Functions@{Threading Functions}} \doxysubsubsection{\texorpdfstring{get\_stack\_size()}{get\_stack\_size()}} {\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} Qore\+::get\+\_\+stack\+\_\+size (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})} returns the current thread\textquotesingle{}s stack size \begin{DoxyParagraph}{Platform Availability\+:} \mbox{\hyperlink{group__option__constants_gae9654317eddd561ad25dbdf76959a60e}{Qore\+::\+Option\+::\+HAVE\+\_\+\+GET\+\_\+\+STACK\+\_\+\+SIZE}} \end{DoxyParagraph} \begin{DoxyParagraph}{Restrictions\+:} \mbox{\hyperlink{group__parse__options_gac379d98e62c57231c2efb7ea87c75a3a}{Qore\+::\+PO\+\_\+\+NO\+\_\+\+THREAD\+\_\+\+INFO}} \end{DoxyParagraph} \begin{DoxyParagraph}{Code Flags\+:} \mbox{\hyperlink{code_flags_CONSTANT}{CONSTANT}} \end{DoxyParagraph} \begin{DoxyParagraph}{Example\+:} \begin{DoxyCode}{0} \DoxyCodeLine{int size = \mbox{\hyperlink{group__threading__functions_gaa97833f603fb51b23fe0bb6c22b7f95f}{get\_stack\_size}}();} \end{DoxyCode} \end{DoxyParagraph} \begin{DoxyReturn}{Returns} the current thread\textquotesingle{}s stack size in bytes \end{DoxyReturn} \begin{DoxyNote}{Note} on Linux, this always returns 8MB for TID 1 (the initial thread) even if the actual stack size is smaller, as Linux automatically extends the initial thread\textquotesingle{}s stack when there is a stack overflow \end{DoxyNote} \begin{DoxySince}{Since} Qore 0.\+9.\+0 \end{DoxySince} \mbox{\Hypertarget{group__threading__functions_gaff3b8af236d59870ff5c6a36c17c4907}\label{group__threading__functions_gaff3b8af236d59870ff5c6a36c17c4907}} \index{Threading Functions@{Threading Functions}!get\_thread\_call\_stack@{get\_thread\_call\_stack}} \index{get\_thread\_call\_stack@{get\_thread\_call\_stack}!Threading Functions@{Threading Functions}} \doxysubsubsection{\texorpdfstring{get\_thread\_call\_stack()}{get\_thread\_call\_stack()}} {\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga4b52a1cbee7a3aed46c32cb0a938629c}{list}}$<$\mbox{\hyperlink{group__type__conversion__functions_ga0231dbb472dd230310af7c7c34f56e92}{hash}}$<$\mbox{\hyperlink{struct_qore_1_1_call_stack_info}{Call\+Stack\+Info}}$>$ $>$ Qore\+::get\+\_\+thread\+\_\+call\+\_\+stack (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})} Returns a list of \mbox{\hyperlink{struct_qore_1_1_call_stack_info}{Call\+Stack\+Info}} hashes for the current TID (thread ID); because it is always from the same thread being read, no locking is applied as in \mbox{\hyperlink{group__threading__functions_gae4d42c6ab7b7fc7d9a9cb1be139f6773}{get\+\_\+all\+\_\+thread\+\_\+call\+\_\+stacks()}} \begin{DoxyReturn}{Returns} a list of \mbox{\hyperlink{struct_qore_1_1_call_stack_info}{Call\+Stack\+Info}} hashes for the current TID (thread ID) \end{DoxyReturn} \begin{DoxyParagraph}{Restrictions\+:} \mbox{\hyperlink{group__parse__options_ga16d8c2b85171b6673b60b5f7d0eaf5eb}{Qore\+::\+PO\+\_\+\+NO\+\_\+\+THREAD\+\_\+\+CONTROL}}, \mbox{\hyperlink{group__parse__options_gac379d98e62c57231c2efb7ea87c75a3a}{Qore\+::\+PO\+\_\+\+NO\+\_\+\+THREAD\+\_\+\+INFO}} \end{DoxyParagraph} \begin{DoxyParagraph}{Example\+:} \begin{DoxyCode}{0} \DoxyCodeLine{list> cs = \mbox{\hyperlink{group__threading__functions_gaff3b8af236d59870ff5c6a36c17c4907}{get\_thread\_call\_stack}}();} \DoxyCodeLine{foreach hash l \textcolor{keywordflow}{in} (cs) \{} \DoxyCodeLine{ \textcolor{keywordflow}{if} (l.type != \textcolor{stringliteral}{"{}new-\/thread"{}}) \{} \DoxyCodeLine{ \mbox{\hyperlink{group__string__functions_ga32070517a9f8a70a32ef48f83a6f128e}{printf}}(\textcolor{stringliteral}{"{} \%d: \%s() called at \%s:\%d (\%s function)\(\backslash\)n"{}}, ++i, l.function, l.file, l.line, l.type);} \DoxyCodeLine{ \} \textcolor{keywordflow}{else} \{} \DoxyCodeLine{ \mbox{\hyperlink{group__string__functions_ga32070517a9f8a70a32ef48f83a6f128e}{printf}}(\textcolor{stringliteral}{"{} \%d: *** thread started by background operator ***\(\backslash\)n"{}}, ++i);} \DoxyCodeLine{ \}} \DoxyCodeLine{\}} \end{DoxyCode} \end{DoxyParagraph} \begin{DoxySince}{Since} Qore 0.\+8.\+13 \end{DoxySince} \mbox{\Hypertarget{group__threading__functions_gafe320b93634b056e4d36ad02086b0638}\label{group__threading__functions_gafe320b93634b056e4d36ad02086b0638}} \index{Threading Functions@{Threading Functions}!get\_thread\_data@{get\_thread\_data}} \index{get\_thread\_data@{get\_thread\_data}!Threading Functions@{Threading Functions}} \doxysubsubsection{\texorpdfstring{get\_thread\_data()}{get\_thread\_data()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}} {\footnotesize\ttfamily nothing Qore\+::get\+\_\+thread\+\_\+data (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})} This function variant does nothing at all; it is only included for backwards-\/compatibility with qore prior to version 0.\+8.\+0 for functions that would ignore type errors in arguments. \begin{DoxyParagraph}{Restrictions\+:} \mbox{\hyperlink{group__parse__options_ga16d8c2b85171b6673b60b5f7d0eaf5eb}{Qore\+::\+PO\+\_\+\+NO\+\_\+\+THREAD\+\_\+\+CONTROL}}, \mbox{\hyperlink{group__parse__options_gac379d98e62c57231c2efb7ea87c75a3a}{Qore\+::\+PO\+\_\+\+NO\+\_\+\+THREAD\+\_\+\+INFO}} \end{DoxyParagraph} \begin{DoxyParagraph}{Code Flags\+:} \mbox{\hyperlink{code_flags_RUNTIME_NOOP}{RUNTIME\+\_\+\+NOOP}} \end{DoxyParagraph} \mbox{\Hypertarget{group__threading__functions_ga1bf3fa656c5e803e9453a5ed84fd556c}\label{group__threading__functions_ga1bf3fa656c5e803e9453a5ed84fd556c}} \index{Threading Functions@{Threading Functions}!get\_thread\_data@{get\_thread\_data}} \index{get\_thread\_data@{get\_thread\_data}!Threading Functions@{Threading Functions}} \doxysubsubsection{\texorpdfstring{get\_thread\_data()}{get\_thread\_data()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}} {\footnotesize\ttfamily auto Qore\+::get\+\_\+thread\+\_\+data (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{key }\end{DoxyParamCaption})} Returns the value of the thread-\/local data attached to the key passed. \begin{DoxyReturn}{Returns} the value of the thread-\/local data attached to the key passed \end{DoxyReturn} \begin{DoxyParagraph}{Restrictions\+:} \mbox{\hyperlink{group__parse__options_ga16d8c2b85171b6673b60b5f7d0eaf5eb}{Qore\+::\+PO\+\_\+\+NO\+\_\+\+THREAD\+\_\+\+CONTROL}}, \mbox{\hyperlink{group__parse__options_gac379d98e62c57231c2efb7ea87c75a3a}{Qore\+::\+PO\+\_\+\+NO\+\_\+\+THREAD\+\_\+\+INFO}} \end{DoxyParagraph} \begin{DoxyParagraph}{Code Flags\+:} \mbox{\hyperlink{code_flags_RET_VALUE_ONLY}{RET\+\_\+\+VALUE\+\_\+\+ONLY}} \end{DoxyParagraph} \begin{DoxyParagraph}{Example\+:} \begin{DoxyCode}{0} \DoxyCodeLine{auto data = \mbox{\hyperlink{group__threading__functions_ga1bf3fa656c5e803e9453a5ed84fd556c}{get\_thread\_data}}(\textcolor{stringliteral}{"{}key1"{}});} \end{DoxyCode} \end{DoxyParagraph} \mbox{\Hypertarget{group__threading__functions_ga79f9cd8de9606cae29c29e3b08d234f0}\label{group__threading__functions_ga79f9cd8de9606cae29c29e3b08d234f0}} \index{Threading Functions@{Threading Functions}!get\_thread\_name@{get\_thread\_name}} \index{get\_thread\_name@{get\_thread\_name}!Threading Functions@{Threading Functions}} \doxysubsubsection{\texorpdfstring{get\_thread\_name()}{get\_thread\_name()}} {\footnotesize\ttfamily \+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} Qore\+::get\+\_\+thread\+\_\+name (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})} returns the current thread\textquotesingle{}s descriptive name if set or \mbox{\hyperlink{basic_data_types_nothing}{NOTHING}} if not \begin{DoxyParagraph}{Platform Availability\+:} \mbox{\hyperlink{group__option__constants_ga5c7b490cc1b6c8749d42067ee4baa7b2}{Qore\+::\+Option\+::\+HAVE\+\_\+\+THREAD\+\_\+\+NAME}} \end{DoxyParagraph} \begin{DoxyParagraph}{Restrictions\+:} \mbox{\hyperlink{group__parse__options_ga16d8c2b85171b6673b60b5f7d0eaf5eb}{Qore\+::\+PO\+\_\+\+NO\+\_\+\+THREAD\+\_\+\+CONTROL}} \end{DoxyParagraph} \begin{DoxyParagraph}{Code Flags\+:} \mbox{\hyperlink{code_flags_CONSTANT}{CONSTANT}} \end{DoxyParagraph} \begin{DoxyParagraph}{Example\+:} \begin{DoxyCode}{0} \DoxyCodeLine{*string name = \mbox{\hyperlink{group__threading__functions_ga79f9cd8de9606cae29c29e3b08d234f0}{get\_thread\_name}}();} \end{DoxyCode} \end{DoxyParagraph} \begin{DoxyReturn}{Returns} the current thread\textquotesingle{}s descriptive name if set or \mbox{\hyperlink{basic_data_types_nothing}{NOTHING}} if not \end{DoxyReturn} \begin{DoxyNote}{Note} \begin{DoxyItemize} \item if supported, the default thread name will be {\ttfamily qore/}{\itshape tid} where {\itshape tid} is the current thread ID \item in case the current platform does not support thread names, \mbox{\hyperlink{basic_data_types_nothing}{NOTHING}} is always returned \end{DoxyItemize} \end{DoxyNote} \begin{DoxySince}{Since} Qore 0.\+9.\+0 \end{DoxySince} \mbox{\Hypertarget{group__threading__functions_gad86831d8ae7b5b1d35e9bb14dc9f6325}\label{group__threading__functions_gad86831d8ae7b5b1d35e9bb14dc9f6325}} \index{Threading Functions@{Threading Functions}!get\_thread\_tz@{get\_thread\_tz}} \index{get\_thread\_tz@{get\_thread\_tz}!Threading Functions@{Threading Functions}} \doxysubsubsection{\texorpdfstring{get\_thread\_tz()}{get\_thread\_tz()}} {\footnotesize\ttfamily \+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{class_qore_1_1_time_zone}{Time\+Zone}} Qore\+::get\+\_\+thread\+\_\+tz (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})} Returns any \mbox{\hyperlink{class_qore_1_1_time_zone}{Time\+Zone}} set for the current thread, \mbox{\hyperlink{basic_data_types_nothing}{NOTHING}} if none is set. \begin{DoxyReturn}{Returns} any \mbox{\hyperlink{class_qore_1_1_time_zone}{Time\+Zone}} set for the current thread, \mbox{\hyperlink{basic_data_types_nothing}{NOTHING}} if none is set \end{DoxyReturn} \begin{DoxyParagraph}{Restrictions\+:} \mbox{\hyperlink{group__parse__options_ga99046cc8285fb26438508cdf29b5771e}{Qore\+::\+PO\+\_\+\+NO\+\_\+\+LOCALE\+\_\+\+CONTROL}} \end{DoxyParagraph} \begin{DoxyParagraph}{Example\+:} \begin{DoxyCode}{0} \DoxyCodeLine{*TimeZone tz = \mbox{\hyperlink{group__threading__functions_gad86831d8ae7b5b1d35e9bb14dc9f6325}{get\_thread\_tz}}();} \DoxyCodeLine{\mbox{\hyperlink{group__threading__functions_ga07fcdce92cacc7cea4b92504a737d7c2}{set\_thread\_tz}}(new TimeZone(\textcolor{stringliteral}{"{}Europe/Prague"{}}));} \DoxyCodeLine{on\_exit \mbox{\hyperlink{group__threading__functions_ga07fcdce92cacc7cea4b92504a737d7c2}{set\_thread\_tz}}(tz);} \end{DoxyCode} \end{DoxyParagraph} \begin{DoxySeeAlso}{See also} \begin{DoxyItemize} \item \mbox{\hyperlink{group__threading__functions_ga07fcdce92cacc7cea4b92504a737d7c2}{set\+\_\+thread\+\_\+tz(\+Time\+Zone)}} \item \mbox{\hyperlink{group__threading__functions_ga07fcdce92cacc7cea4b92504a737d7c2}{set\+\_\+thread\+\_\+tz()}} \end{DoxyItemize} \end{DoxySeeAlso} \begin{DoxySince}{Since} Qore 0.\+8.\+5 \end{DoxySince} \mbox{\Hypertarget{group__threading__functions_ga52baa4131379e22e307ae742ffbe3ee1}\label{group__threading__functions_ga52baa4131379e22e307ae742ffbe3ee1}} \index{Threading Functions@{Threading Functions}!getAllThreadCallStacks@{getAllThreadCallStacks}} \index{getAllThreadCallStacks@{getAllThreadCallStacks}!Threading Functions@{Threading Functions}} \doxysubsubsection{\texorpdfstring{getAllThreadCallStacks()}{getAllThreadCallStacks()}} {\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga0231dbb472dd230310af7c7c34f56e92}{hash}}$<$\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}},\mbox{\hyperlink{group__type__conversion__functions_ga4b52a1cbee7a3aed46c32cb0a938629c}{list}}$<$\mbox{\hyperlink{group__type__conversion__functions_ga0231dbb472dd230310af7c7c34f56e92}{hash}}$<$\mbox{\hyperlink{struct_qore_1_1_call_stack_info}{Call\+Stack\+Info}}$>$ $>$ $>$ Qore\+::get\+All\+Thread\+Call\+Stacks (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})} Returns a hash of lists of \mbox{\hyperlink{struct_qore_1_1_call_stack_info}{Call\+Stack\+Info}} hashes keyed by TID (thread ID) \begin{DoxyParagraph}{Restrictions\+:} \mbox{\hyperlink{group__parse__options_ga16d8c2b85171b6673b60b5f7d0eaf5eb}{Qore\+::\+PO\+\_\+\+NO\+\_\+\+THREAD\+\_\+\+CONTROL}}, \mbox{\hyperlink{group__parse__options_gac379d98e62c57231c2efb7ea87c75a3a}{Qore\+::\+PO\+\_\+\+NO\+\_\+\+THREAD\+\_\+\+INFO}} \end{DoxyParagraph} \begin{DoxyParagraph}{Code Flags\+:} \mbox{\hyperlink{code_flags_DEPRECATED}{DEPRECATED}} \end{DoxyParagraph} \begin{DoxyReturn}{Returns} a hash of lists of \mbox{\hyperlink{struct_qore_1_1_call_stack_info}{Call\+Stack\+Info}} hashes keyed by TID (thread ID) \end{DoxyReturn} \begin{DoxyRefDesc}{Deprecated} \item[\mbox{\hyperlink{deprecated__deprecated000036}{Deprecated}}]use \mbox{\hyperlink{group__threading__functions_gae4d42c6ab7b7fc7d9a9cb1be139f6773}{get\+\_\+all\+\_\+thread\+\_\+call\+\_\+stacks()}}; camel-\/case function names were deprecated in Qore 0.\+8.\+12 \end{DoxyRefDesc} \mbox{\Hypertarget{group__threading__functions_ga95ed8e572309b44b3f5b49673238c3e6}\label{group__threading__functions_ga95ed8e572309b44b3f5b49673238c3e6}} \index{Threading Functions@{Threading Functions}!gettid@{gettid}} \index{gettid@{gettid}!Threading Functions@{Threading Functions}} \doxysubsubsection{\texorpdfstring{gettid()}{gettid()}} {\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} Qore\+::gettid (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})} Returns the Qore thread ID (TID) of the current thread. \begin{DoxyReturn}{Returns} the Qore thread ID (TID) of the current thread \end{DoxyReturn} \begin{DoxyParagraph}{Restrictions\+:} \mbox{\hyperlink{group__parse__options_gac379d98e62c57231c2efb7ea87c75a3a}{Qore\+::\+PO\+\_\+\+NO\+\_\+\+THREAD\+\_\+\+INFO}} \end{DoxyParagraph} \begin{DoxyParagraph}{Code Flags\+:} \mbox{\hyperlink{code_flags_RET_VALUE_ONLY}{RET\+\_\+\+VALUE\+\_\+\+ONLY}} \end{DoxyParagraph} \begin{DoxyParagraph}{Example\+:} \begin{DoxyCode}{0} \DoxyCodeLine{int tid = \mbox{\hyperlink{group__threading__functions_ga95ed8e572309b44b3f5b49673238c3e6}{gettid}}();} \end{DoxyCode} \end{DoxyParagraph} \begin{DoxyNote}{Note} this function is not flagged with \mbox{\hyperlink{code_flags_CONSTANT}{CONSTANT}} since its value could change at runtime \end{DoxyNote} \mbox{\Hypertarget{group__threading__functions_gafa1c0f9e429a945b66fb261c7fa1b5bd}\label{group__threading__functions_gafa1c0f9e429a945b66fb261c7fa1b5bd}} \index{Threading Functions@{Threading Functions}!mark\_thread\_resources@{mark\_thread\_resources}} \index{mark\_thread\_resources@{mark\_thread\_resources}!Threading Functions@{Threading Functions}} \doxysubsubsection{\texorpdfstring{mark\_thread\_resources()}{mark\_thread\_resources()}} {\footnotesize\ttfamily nothing Qore\+::mark\+\_\+thread\+\_\+resources (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})} Marks thread resources so that any thread resources left allocated after this call will be cleaned up when \mbox{\hyperlink{group__threading__functions_ga4e62409b8a1b414276d033267e7299e4}{throw\+\_\+thread\+\_\+resource\+\_\+exceptions\+\_\+to\+\_\+mark()}} is called. When exceptions are thrown by this function, thread-\/local resources are also cleaned up at the same time. \begin{DoxyParagraph}{Restrictions\+:} \mbox{\hyperlink{group__parse__options_ga16d8c2b85171b6673b60b5f7d0eaf5eb}{Qore\+::\+PO\+\_\+\+NO\+\_\+\+THREAD\+\_\+\+CONTROL}} \end{DoxyParagraph} \begin{DoxyParagraph}{Example\+:} \begin{DoxyCode}{0} \DoxyCodeLine{\textcolor{keywordflow}{try} \{} \DoxyCodeLine{ \mbox{\hyperlink{group__threading__functions_gafa1c0f9e429a945b66fb261c7fa1b5bd}{mark\_thread\_resources}}();} \DoxyCodeLine{} \DoxyCodeLine{ \textcolor{comment}{\# calling the following function will ensure that any thread-\/resources}} \DoxyCodeLine{ \textcolor{comment}{\# allocated since the last call to mark\_thread\_resources() will be cleaned}} \DoxyCodeLine{ \textcolor{comment}{\# up and associated exceptions will be thrown}} \DoxyCodeLine{ on\_exit \mbox{\hyperlink{group__threading__functions_ga4e62409b8a1b414276d033267e7299e4}{throw\_thread\_resource\_exceptions\_to\_mark}}();} \DoxyCodeLine{} \DoxyCodeLine{ \textcolor{comment}{\# ... some code or calls that may allocate thread resources}} \DoxyCodeLine{\} catch (hash ex) \{} \DoxyCodeLine{ \textcolor{comment}{\# ... log or handle exceptions}} \DoxyCodeLine{\}} \end{DoxyCode} \end{DoxyParagraph} \begin{DoxySeeAlso}{See also} \begin{DoxyItemize} \item \mbox{\hyperlink{threading_thread_resources}{Thread Resources}} \item \mbox{\hyperlink{group__threading__functions_gadc994316e54fdf50111018de9bd15dc6}{remove\+\_\+thread\+\_\+resource()}} \item \mbox{\hyperlink{group__threading__functions_ga1a1fbc371cfc8885ed78e4bff25d35b1}{set\+\_\+thread\+\_\+resource()}} \item \mbox{\hyperlink{group__threading__functions_ga421dca39ccb55b191d5d09fd98c2075a}{throw\+\_\+thread\+\_\+resource\+\_\+exceptions()}} \item \mbox{\hyperlink{group__threading__functions_ga4e62409b8a1b414276d033267e7299e4}{throw\+\_\+thread\+\_\+resource\+\_\+exceptions\+\_\+to\+\_\+mark()}} \item \mbox{\hyperlink{class_qore_1_1_thread_1_1_abstract_thread_resource}{Abstract\+Thread\+Resource}} \end{DoxyItemize} \end{DoxySeeAlso} \begin{DoxySince}{Since} Qore 0.\+8.\+4 \end{DoxySince} \mbox{\Hypertarget{group__threading__functions_ga4bffba0876346fe5233ed4f5161c90d0}\label{group__threading__functions_ga4bffba0876346fe5233ed4f5161c90d0}} \index{Threading Functions@{Threading Functions}!num\_threads@{num\_threads}} \index{num\_threads@{num\_threads}!Threading Functions@{Threading Functions}} \doxysubsubsection{\texorpdfstring{num\_threads()}{num\_threads()}} {\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} Qore\+::num\+\_\+threads (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})} Returns the current number of threads in the process (not including the special \mbox{\hyperlink{signal_handling}{signal handling thread}}) \begin{DoxyReturn}{Returns} the current number of threads in the process (not including the special \mbox{\hyperlink{signal_handling}{signal handling thread}}) \end{DoxyReturn} \begin{DoxyParagraph}{Restrictions\+:} \mbox{\hyperlink{group__parse__options_gac379d98e62c57231c2efb7ea87c75a3a}{Qore\+::\+PO\+\_\+\+NO\+\_\+\+THREAD\+\_\+\+INFO}} \end{DoxyParagraph} \begin{DoxyParagraph}{Code Flags\+:} \mbox{\hyperlink{code_flags_RET_VALUE_ONLY}{RET\+\_\+\+VALUE\+\_\+\+ONLY}} \end{DoxyParagraph} \begin{DoxyParagraph}{Example\+:} \begin{DoxyCode}{0} \DoxyCodeLine{int num = \mbox{\hyperlink{group__threading__functions_ga4bffba0876346fe5233ed4f5161c90d0}{num\_threads}}();} \end{DoxyCode} \end{DoxyParagraph} \begin{DoxyNote}{Note} this function is not flagged with \mbox{\hyperlink{code_flags_CONSTANT}{CONSTANT}} since its value could change at runtime \end{DoxyNote} \mbox{\Hypertarget{group__threading__functions_ga33a9531a01ae17fc2560f95c0b2039be}\label{group__threading__functions_ga33a9531a01ae17fc2560f95c0b2039be}} \index{Threading Functions@{Threading Functions}!remove\_thread\_data@{remove\_thread\_data}} \index{remove\_thread\_data@{remove\_thread\_data}!Threading Functions@{Threading Functions}} \doxysubsubsection{\texorpdfstring{remove\_thread\_data()}{remove\_thread\_data()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}} {\footnotesize\ttfamily \+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_ga0231dbb472dd230310af7c7c34f56e92}{hash}}$<$auto$>$ Qore\+::remove\+\_\+thread\+\_\+data (\begin{DoxyParamCaption}\item[{}]{... }\end{DoxyParamCaption})} Removes the data associated to one or more keys in the thread-\/local data hash and returns the data removed. \begin{DoxyParagraph}{Restrictions\+:} \mbox{\hyperlink{group__parse__options_ga16d8c2b85171b6673b60b5f7d0eaf5eb}{Qore\+::\+PO\+\_\+\+NO\+\_\+\+THREAD\+\_\+\+CONTROL}} \end{DoxyParagraph} \begin{DoxyParams}{Parameters} {\em ...} & the key names should be given directly in the argument list with this variant. If the given hash keys do not exist in the thread-\/local data hash, then the given key in the return value will have no value assigned\\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} a hash of the data removed or \mbox{\hyperlink{basic_data_types_nothing}{NOTHING}} if no arguments were passed to the function \end{DoxyReturn} \begin{DoxyParagraph}{Example\+:} \begin{DoxyCode}{0} \DoxyCodeLine{hash h = \mbox{\hyperlink{group__threading__functions_ga33a9531a01ae17fc2560f95c0b2039be}{remove\_thread\_data}}(\textcolor{stringliteral}{"{}filename"{}});} \end{DoxyCode} \end{DoxyParagraph} \begin{DoxySince}{Since} Qore 0.\+8.\+4 this function returns the values it removes \end{DoxySince} \mbox{\Hypertarget{group__threading__functions_ga13a9048eefe3d5cd6398f29e2b5bb05a}\label{group__threading__functions_ga13a9048eefe3d5cd6398f29e2b5bb05a}} \index{Threading Functions@{Threading Functions}!remove\_thread\_data@{remove\_thread\_data}} \index{remove\_thread\_data@{remove\_thread\_data}!Threading Functions@{Threading Functions}} \doxysubsubsection{\texorpdfstring{remove\_thread\_data()}{remove\_thread\_data()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}} {\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga0231dbb472dd230310af7c7c34f56e92}{hash}}$<$auto$>$ Qore\+::remove\+\_\+thread\+\_\+data (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_ga4b52a1cbee7a3aed46c32cb0a938629c}{list}}$<$ softstring $>$}]{l }\end{DoxyParamCaption})} Removes the data associated to one or more keys in the thread-\/local data hash from a literal list passed as the first argument and returns the data removed. \begin{DoxyParagraph}{Restrictions\+:} \mbox{\hyperlink{group__parse__options_ga16d8c2b85171b6673b60b5f7d0eaf5eb}{Qore\+::\+PO\+\_\+\+NO\+\_\+\+THREAD\+\_\+\+CONTROL}} \end{DoxyParagraph} \begin{DoxyParams}{Parameters} {\em l} & a list of key names to remove from the thread-\/local data hash. If the given hash keys do not exist in the thread-\/local data hash, then the given key in the return value will have no value assigned\\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} a hash of the data removed \end{DoxyReturn} \begin{DoxyParagraph}{Example\+:} \begin{DoxyCode}{0} \DoxyCodeLine{hash h = \mbox{\hyperlink{group__threading__functions_ga33a9531a01ae17fc2560f95c0b2039be}{remove\_thread\_data}}(key\_list);} \end{DoxyCode} \end{DoxyParagraph} \begin{DoxySince}{Since} Qore 0.\+8.\+4 this function returns the values it removes \end{DoxySince} \mbox{\Hypertarget{group__threading__functions_gadc994316e54fdf50111018de9bd15dc6}\label{group__threading__functions_gadc994316e54fdf50111018de9bd15dc6}} \index{Threading Functions@{Threading Functions}!remove\_thread\_resource@{remove\_thread\_resource}} \index{remove\_thread\_resource@{remove\_thread\_resource}!Threading Functions@{Threading Functions}} \doxysubsubsection{\texorpdfstring{remove\_thread\_resource()}{remove\_thread\_resource()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}} {\footnotesize\ttfamily bool Qore\+::remove\+\_\+thread\+\_\+resource (\begin{DoxyParamCaption}\item[{Abstract\+Thread\+Resource}]{resource }\end{DoxyParamCaption})} removes a thread resource from the current thread \begin{DoxyParagraph}{Restrictions\+:} \mbox{\hyperlink{group__parse__options_ga16d8c2b85171b6673b60b5f7d0eaf5eb}{Qore\+::\+PO\+\_\+\+NO\+\_\+\+THREAD\+\_\+\+CONTROL}} \end{DoxyParagraph} \begin{DoxyParagraph}{Example\+:} \begin{DoxyCode}{0} \DoxyCodeLine{\mbox{\hyperlink{group__threading__functions_gadc994316e54fdf50111018de9bd15dc6}{remove\_thread\_resource}}(obj);} \end{DoxyCode} \end{DoxyParagraph} \begin{DoxyParams}{Parameters} {\em resource} & the thread resource to remove\\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} True if the resource was removed, False if not \end{DoxyReturn} \begin{DoxySeeAlso}{See also} \begin{DoxyItemize} \item \mbox{\hyperlink{threading_thread_resources}{Thread Resources}} \item \mbox{\hyperlink{group__threading__functions_gafa1c0f9e429a945b66fb261c7fa1b5bd}{mark\+\_\+thread\+\_\+resources()}} \item \mbox{\hyperlink{group__threading__functions_ga1a1fbc371cfc8885ed78e4bff25d35b1}{set\+\_\+thread\+\_\+resource()}} \item \mbox{\hyperlink{group__threading__functions_ga421dca39ccb55b191d5d09fd98c2075a}{throw\+\_\+thread\+\_\+resource\+\_\+exceptions()}} \item \mbox{\hyperlink{group__threading__functions_ga4e62409b8a1b414276d033267e7299e4}{throw\+\_\+thread\+\_\+resource\+\_\+exceptions\+\_\+to\+\_\+mark()}} \item \mbox{\hyperlink{class_qore_1_1_thread_1_1_abstract_thread_resource}{Abstract\+Thread\+Resource}} \end{DoxyItemize} \end{DoxySeeAlso} \begin{DoxySince}{Since} Qore 0.\+8.\+12 \end{DoxySince} \mbox{\Hypertarget{group__threading__functions_gac1735e87940d93e2614485c050217ac5}\label{group__threading__functions_gac1735e87940d93e2614485c050217ac5}} \index{Threading Functions@{Threading Functions}!remove\_thread\_resource@{remove\_thread\_resource}} \index{remove\_thread\_resource@{remove\_thread\_resource}!Threading Functions@{Threading Functions}} \doxysubsubsection{\texorpdfstring{remove\_thread\_resource()}{remove\_thread\_resource()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}} {\footnotesize\ttfamily bool Qore\+::remove\+\_\+thread\+\_\+resource (\begin{DoxyParamCaption}\item[{code}]{resource }\end{DoxyParamCaption})} removes a callable thread resource from the current thread \begin{DoxyParagraph}{Restrictions\+:} \mbox{\hyperlink{group__parse__options_ga16d8c2b85171b6673b60b5f7d0eaf5eb}{Qore\+::\+PO\+\_\+\+NO\+\_\+\+THREAD\+\_\+\+CONTROL}} \end{DoxyParagraph} \begin{DoxyParagraph}{Example\+:} \begin{DoxyCode}{0} \DoxyCodeLine{\mbox{\hyperlink{group__threading__functions_gadc994316e54fdf50111018de9bd15dc6}{remove\_thread\_resource}}(\(\backslash\)func());} \end{DoxyCode} \end{DoxyParagraph} \begin{DoxyParams}{Parameters} {\em resource} & the callable thread resource to remove\\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} True if the resource was removed, False if not \end{DoxyReturn} \begin{DoxySeeAlso}{See also} \begin{DoxyItemize} \item \mbox{\hyperlink{threading_thread_resources}{Thread Resources}} \item \mbox{\hyperlink{group__threading__functions_gafa1c0f9e429a945b66fb261c7fa1b5bd}{mark\+\_\+thread\+\_\+resources()}} \item \mbox{\hyperlink{group__threading__functions_ga1a1fbc371cfc8885ed78e4bff25d35b1}{set\+\_\+thread\+\_\+resource()}} \item \mbox{\hyperlink{group__threading__functions_ga421dca39ccb55b191d5d09fd98c2075a}{throw\+\_\+thread\+\_\+resource\+\_\+exceptions()}} \item \mbox{\hyperlink{group__threading__functions_ga4e62409b8a1b414276d033267e7299e4}{throw\+\_\+thread\+\_\+resource\+\_\+exceptions\+\_\+to\+\_\+mark()}} \item \mbox{\hyperlink{class_qore_1_1_thread_1_1_abstract_thread_resource}{Abstract\+Thread\+Resource}} \end{DoxyItemize} \end{DoxySeeAlso} \begin{DoxySince}{Since} Qore 0.\+8.\+12 \end{DoxySince} \mbox{\Hypertarget{group__threading__functions_ga1da332e389e3083ba80d45aaec0525c6}\label{group__threading__functions_ga1da332e389e3083ba80d45aaec0525c6}} \index{Threading Functions@{Threading Functions}!save\_thread\_data@{save\_thread\_data}} \index{save\_thread\_data@{save\_thread\_data}!Threading Functions@{Threading Functions}} \doxysubsubsection{\texorpdfstring{save\_thread\_data()}{save\_thread\_data()}\hspace{0.1cm}{\footnotesize\ttfamily [1/3]}} {\footnotesize\ttfamily nothing Qore\+::save\+\_\+thread\+\_\+data (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})} This function variant does nothing at all; it is only included for backwards-\/compatibility with qore prior to version 0.\+8.\+0 for functions that would ignore type errors in arguments. \begin{DoxyParagraph}{Restrictions\+:} \mbox{\hyperlink{group__parse__options_ga16d8c2b85171b6673b60b5f7d0eaf5eb}{Qore\+::\+PO\+\_\+\+NO\+\_\+\+THREAD\+\_\+\+CONTROL}} \end{DoxyParagraph} \begin{DoxyParagraph}{Code Flags\+:} \mbox{\hyperlink{code_flags_RUNTIME_NOOP}{RUNTIME\+\_\+\+NOOP}} \end{DoxyParagraph} \mbox{\Hypertarget{group__threading__functions_ga496d14c02dcc992bf82fefbfe6a0d1ca}\label{group__threading__functions_ga496d14c02dcc992bf82fefbfe6a0d1ca}} \index{Threading Functions@{Threading Functions}!save\_thread\_data@{save\_thread\_data}} \index{save\_thread\_data@{save\_thread\_data}!Threading Functions@{Threading Functions}} \doxysubsubsection{\texorpdfstring{save\_thread\_data()}{save\_thread\_data()}\hspace{0.1cm}{\footnotesize\ttfamily [2/3]}} {\footnotesize\ttfamily nothing Qore\+::save\+\_\+thread\+\_\+data (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_ga0231dbb472dd230310af7c7c34f56e92}{hash}}$<$ auto $>$}]{h }\end{DoxyParamCaption})} Saves the data passed in the thread-\/local hash; all keys are merged into the thread-\/local hash, overwriting any information that may have been there before. \begin{DoxyParagraph}{Restrictions\+:} \mbox{\hyperlink{group__parse__options_ga16d8c2b85171b6673b60b5f7d0eaf5eb}{Qore\+::\+PO\+\_\+\+NO\+\_\+\+THREAD\+\_\+\+CONTROL}} \end{DoxyParagraph} \begin{DoxyParams}{Parameters} {\em h} & a hash of data to save in the thread-\/local data hash\\ \hline \end{DoxyParams} \begin{DoxyParagraph}{Example\+:} \begin{DoxyCode}{0} \DoxyCodeLine{\mbox{\hyperlink{group__threading__functions_ga496d14c02dcc992bf82fefbfe6a0d1ca}{save\_thread\_data}}(h);} \end{DoxyCode} \end{DoxyParagraph} \begin{DoxyNote}{Note} This function does not throw any exceptions, however if a value is removed from the thread-\/local data hash by being overwritten with a new value, and the value is an object that goes out of scope, then such an object could throw an exception in its destructor \end{DoxyNote} \mbox{\Hypertarget{group__threading__functions_ga19470247ebe21daddfae06b2e98238b5}\label{group__threading__functions_ga19470247ebe21daddfae06b2e98238b5}} \index{Threading Functions@{Threading Functions}!save\_thread\_data@{save\_thread\_data}} \index{save\_thread\_data@{save\_thread\_data}!Threading Functions@{Threading Functions}} \doxysubsubsection{\texorpdfstring{save\_thread\_data()}{save\_thread\_data()}\hspace{0.1cm}{\footnotesize\ttfamily [3/3]}} {\footnotesize\ttfamily nothing Qore\+::save\+\_\+thread\+\_\+data (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{key, }\item[{auto}]{value }\end{DoxyParamCaption})} Saves the data passed against the key passed as an argument in thread-\/local storage. \begin{DoxyParagraph}{Restrictions\+:} \mbox{\hyperlink{group__parse__options_ga16d8c2b85171b6673b60b5f7d0eaf5eb}{Qore\+::\+PO\+\_\+\+NO\+\_\+\+THREAD\+\_\+\+CONTROL}} \end{DoxyParagraph} \begin{DoxyParams}{Parameters} {\em key} & the name of the key in the thread-\/local hash to save the data against \\ \hline {\em value} & the value to save in the thread-\/local hash against the key\\ \hline \end{DoxyParams} \begin{DoxyParagraph}{Example\+:} \begin{DoxyCode}{0} \DoxyCodeLine{\mbox{\hyperlink{group__threading__functions_ga496d14c02dcc992bf82fefbfe6a0d1ca}{save\_thread\_data}}(\textcolor{stringliteral}{"{}key1"{}}, value);} \end{DoxyCode} \end{DoxyParagraph} \begin{DoxyNote}{Note} This function does not throw any exceptions, however if a value is removed from the thread-\/local data hash by being overwritten with a new value, and the value is an object that goes out of scope, then such an object could throw an exception in its destructor \end{DoxyNote} \mbox{\Hypertarget{group__threading__functions_gadbd86685c49fd7b4960b8b21e05cb2f0}\label{group__threading__functions_gadbd86685c49fd7b4960b8b21e05cb2f0}} \index{Threading Functions@{Threading Functions}!set\_default\_thread\_stack\_size@{set\_default\_thread\_stack\_size}} \index{set\_default\_thread\_stack\_size@{set\_default\_thread\_stack\_size}!Threading Functions@{Threading Functions}} \doxysubsubsection{\texorpdfstring{set\_default\_thread\_stack\_size()}{set\_default\_thread\_stack\_size()}} {\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} Qore\+::set\+\_\+default\+\_\+thread\+\_\+stack\+\_\+size (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}}}]{size }\end{DoxyParamCaption})} sets the default thread stack size for new threads created after this call and returns the stack size actually set \begin{DoxyParagraph}{Platform Availability\+:} \mbox{\hyperlink{group__option__constants_ga3e3b196e3ae7f8b26e890ce36c120901}{Qore\+::\+Option\+::\+HAVE\+\_\+\+MANAGE\+\_\+\+STACK}} \end{DoxyParagraph} \begin{DoxyParagraph}{Restrictions\+:} \mbox{\hyperlink{group__parse__options_ga16d8c2b85171b6673b60b5f7d0eaf5eb}{Qore\+::\+PO\+\_\+\+NO\+\_\+\+THREAD\+\_\+\+CONTROL}} \end{DoxyParagraph} \begin{DoxyParagraph}{Example\+:} \begin{DoxyCode}{0} \DoxyCodeLine{int size = \mbox{\hyperlink{group__threading__functions_gadbd86685c49fd7b4960b8b21e05cb2f0}{set\_default\_thread\_stack\_size}}(size);} \end{DoxyCode} \end{DoxyParagraph} \begin{DoxyParams}{Parameters} {\em size} & the size in bytes for new threads\\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} the value actually set \end{DoxyReturn} \begin{DoxyExceptions}{Exceptions} {\em SET-\/\+DEFAULT-\/\+THREAD-\/\+STACK-\/\+SIZE-\/\+ERROR} & an error occurred setting the default thread stack size\\ \hline \end{DoxyExceptions} \begin{DoxySince}{Since} Qore 0.\+9.\+0 \end{DoxySince} \mbox{\Hypertarget{group__threading__functions_gae83c32576b59a1ecfa906d9b3c3af557}\label{group__threading__functions_gae83c32576b59a1ecfa906d9b3c3af557}} \index{Threading Functions@{Threading Functions}!set\_thread\_init@{set\_thread\_init}} \index{set\_thread\_init@{set\_thread\_init}!Threading Functions@{Threading Functions}} \doxysubsubsection{\texorpdfstring{set\_thread\_init()}{set\_thread\_init()}} {\footnotesize\ttfamily bool Qore\+::set\+\_\+thread\+\_\+init (\begin{DoxyParamCaption}\item[{\+\_\+\+\_\+7\+\_\+ code}]{init }\end{DoxyParamCaption})} Sets a \mbox{\hyperlink{expressions_call_reference}{call reference}} or \mbox{\hyperlink{expressions_closure}{closure}} to run every time a new thread is started. This code can be used to initialize \mbox{\hyperlink{threading_threading_and_variables}{global thread-\/local variables}}, for example. \begin{DoxyParagraph}{Restrictions\+:} \mbox{\hyperlink{group__parse__options_ga16d8c2b85171b6673b60b5f7d0eaf5eb}{Qore\+::\+PO\+\_\+\+NO\+\_\+\+THREAD\+\_\+\+CONTROL}} \end{DoxyParagraph} \begin{DoxyParams}{Parameters} {\em init} & a \mbox{\hyperlink{expressions_call_reference}{call reference}} or \mbox{\hyperlink{expressions_closure}{closure}} to run every time a new thread is started or \mbox{\hyperlink{basic_data_types_nothing}{NOTHING}} to clear any thread initialization code\\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} \mbox{\hyperlink{basic_data_types_True}{True}} if there was already user initialization code set, \mbox{\hyperlink{basic_data_types_False}{False}} if not \end{DoxyReturn} \begin{DoxyParagraph}{Example\+:} \begin{DoxyCode}{0} \DoxyCodeLine{\mbox{\hyperlink{group__threading__functions_gae83c32576b59a1ecfa906d9b3c3af557}{set\_thread\_init}}(sub () \{ var = 123; \});} \end{DoxyCode} \end{DoxyParagraph} \begin{DoxyNote}{Note} the code will be run for all new threads, but is not run by this function for the current thread \end{DoxyNote} \begin{DoxySeeAlso}{See also} \mbox{\hyperlink{class_qore_1_1_program_a6fda138e987e698d3c5b11294d21bcdb}{Qore\+::\+Program\+::set\+Thread\+Init()}} \end{DoxySeeAlso} \begin{DoxySince}{Since} Qore 0.\+8.\+13 added the ability to remove the thread initialization code by passing \mbox{\hyperlink{basic_data_types_nothing}{NOTHING}} to this function \end{DoxySince} \mbox{\Hypertarget{group__threading__functions_ga321040a3e764383dd68c50d496436e87}\label{group__threading__functions_ga321040a3e764383dd68c50d496436e87}} \index{Threading Functions@{Threading Functions}!set\_thread\_name@{set\_thread\_name}} \index{set\_thread\_name@{set\_thread\_name}!Threading Functions@{Threading Functions}} \doxysubsubsection{\texorpdfstring{set\_thread\_name()}{set\_thread\_name()}} {\footnotesize\ttfamily nothing Qore\+::set\+\_\+thread\+\_\+name (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{name }\end{DoxyParamCaption})} sets the current thread\textquotesingle{}s descriptive name \begin{DoxyParagraph}{Platform Availability\+:} \mbox{\hyperlink{group__option__constants_ga5c7b490cc1b6c8749d42067ee4baa7b2}{Qore\+::\+Option\+::\+HAVE\+\_\+\+THREAD\+\_\+\+NAME}} \end{DoxyParagraph} \begin{DoxyParagraph}{Restrictions\+:} \mbox{\hyperlink{group__parse__options_ga16d8c2b85171b6673b60b5f7d0eaf5eb}{Qore\+::\+PO\+\_\+\+NO\+\_\+\+THREAD\+\_\+\+CONTROL}} \end{DoxyParagraph} \begin{DoxyParagraph}{Example\+:} \begin{DoxyCode}{0} \DoxyCodeLine{\mbox{\hyperlink{group__threading__functions_ga321040a3e764383dd68c50d496436e87}{set\_thread\_name}}(name);} \end{DoxyCode} \end{DoxyParagraph} \begin{DoxyParams}{Parameters} {\em name} & the new descriptive name for the thread\\ \hline \end{DoxyParams} \begin{DoxySince}{Since} Qore 0.\+9.\+0 \end{DoxySince} \mbox{\Hypertarget{group__threading__functions_ga1a1fbc371cfc8885ed78e4bff25d35b1}\label{group__threading__functions_ga1a1fbc371cfc8885ed78e4bff25d35b1}} \index{Threading Functions@{Threading Functions}!set\_thread\_resource@{set\_thread\_resource}} \index{set\_thread\_resource@{set\_thread\_resource}!Threading Functions@{Threading Functions}} \doxysubsubsection{\texorpdfstring{set\_thread\_resource()}{set\_thread\_resource()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}} {\footnotesize\ttfamily nothing Qore\+::set\+\_\+thread\+\_\+resource (\begin{DoxyParamCaption}\item[{Abstract\+Thread\+Resource}]{resource }\end{DoxyParamCaption})} sets a thread resource for the current thread \begin{DoxyParagraph}{Restrictions\+:} \mbox{\hyperlink{group__parse__options_ga16d8c2b85171b6673b60b5f7d0eaf5eb}{Qore\+::\+PO\+\_\+\+NO\+\_\+\+THREAD\+\_\+\+CONTROL}} \end{DoxyParagraph} \begin{DoxyParagraph}{Example\+:} \begin{DoxyCode}{0} \DoxyCodeLine{\mbox{\hyperlink{group__threading__functions_ga1a1fbc371cfc8885ed78e4bff25d35b1}{set\_thread\_resource}}(obj);} \end{DoxyCode} \end{DoxyParagraph} \begin{DoxyParams}{Parameters} {\em resource} & the thread resource to set\\ \hline \end{DoxyParams} \begin{DoxySeeAlso}{See also} \begin{DoxyItemize} \item \mbox{\hyperlink{threading_thread_resources}{Thread Resources}} \item \mbox{\hyperlink{group__threading__functions_gafa1c0f9e429a945b66fb261c7fa1b5bd}{mark\+\_\+thread\+\_\+resources()}} \item \mbox{\hyperlink{group__threading__functions_gadc994316e54fdf50111018de9bd15dc6}{remove\+\_\+thread\+\_\+resource()}} \item \mbox{\hyperlink{group__threading__functions_ga421dca39ccb55b191d5d09fd98c2075a}{throw\+\_\+thread\+\_\+resource\+\_\+exceptions()}} \item \mbox{\hyperlink{group__threading__functions_ga4e62409b8a1b414276d033267e7299e4}{throw\+\_\+thread\+\_\+resource\+\_\+exceptions\+\_\+to\+\_\+mark()}} \item \mbox{\hyperlink{class_qore_1_1_thread_1_1_abstract_thread_resource}{Abstract\+Thread\+Resource}} \end{DoxyItemize} \end{DoxySeeAlso} \begin{DoxySince}{Since} Qore 0.\+8.\+12 \end{DoxySince} \mbox{\Hypertarget{group__threading__functions_ga2ef317e679a8362978e08c8ad3368014}\label{group__threading__functions_ga2ef317e679a8362978e08c8ad3368014}} \index{Threading Functions@{Threading Functions}!set\_thread\_resource@{set\_thread\_resource}} \index{set\_thread\_resource@{set\_thread\_resource}!Threading Functions@{Threading Functions}} \doxysubsubsection{\texorpdfstring{set\_thread\_resource()}{set\_thread\_resource()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}} {\footnotesize\ttfamily nothing Qore\+::set\+\_\+thread\+\_\+resource (\begin{DoxyParamCaption}\item[{code}]{resource, }\item[{auto}]{arg }\end{DoxyParamCaption})} sets a callable thread resource for the current thread with an optional argument \begin{DoxyParagraph}{Restrictions\+:} \mbox{\hyperlink{group__parse__options_ga16d8c2b85171b6673b60b5f7d0eaf5eb}{Qore\+::\+PO\+\_\+\+NO\+\_\+\+THREAD\+\_\+\+CONTROL}} \end{DoxyParagraph} \begin{DoxyParagraph}{Example\+:} \begin{DoxyCode}{0} \DoxyCodeLine{\mbox{\hyperlink{group__threading__functions_ga1a1fbc371cfc8885ed78e4bff25d35b1}{set\_thread\_resource}}(\(\backslash\)func(), code);} \end{DoxyCode} \end{DoxyParagraph} \begin{DoxyParams}{Parameters} {\em resource} & the thread resource handler to set \\ \hline {\em arg} & an argument to use when calling the thread resource handler\\ \hline \end{DoxyParams} \begin{DoxySeeAlso}{See also} \begin{DoxyItemize} \item \mbox{\hyperlink{threading_thread_resources}{Thread Resources}} \item \mbox{\hyperlink{group__threading__functions_gafa1c0f9e429a945b66fb261c7fa1b5bd}{mark\+\_\+thread\+\_\+resources()}} \item \mbox{\hyperlink{group__threading__functions_gadc994316e54fdf50111018de9bd15dc6}{remove\+\_\+thread\+\_\+resource()}} \item \mbox{\hyperlink{group__threading__functions_ga421dca39ccb55b191d5d09fd98c2075a}{throw\+\_\+thread\+\_\+resource\+\_\+exceptions()}} \item \mbox{\hyperlink{group__threading__functions_ga4e62409b8a1b414276d033267e7299e4}{throw\+\_\+thread\+\_\+resource\+\_\+exceptions\+\_\+to\+\_\+mark()}} \item \mbox{\hyperlink{class_qore_1_1_thread_1_1_abstract_thread_resource}{Abstract\+Thread\+Resource}} \end{DoxyItemize} \end{DoxySeeAlso} \begin{DoxySince}{Since} Qore 0.\+8.\+12 \end{DoxySince} \mbox{\Hypertarget{group__threading__functions_ga21c1462b384cf6a52d20195bb3b6cf90}\label{group__threading__functions_ga21c1462b384cf6a52d20195bb3b6cf90}} \index{Threading Functions@{Threading Functions}!set\_thread\_tz@{set\_thread\_tz}} \index{set\_thread\_tz@{set\_thread\_tz}!Threading Functions@{Threading Functions}} \doxysubsubsection{\texorpdfstring{set\_thread\_tz()}{set\_thread\_tz()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}} {\footnotesize\ttfamily nothing Qore\+::set\+\_\+thread\+\_\+tz (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})} Clears the thread-\/local time zone for the current thread; after this call \mbox{\hyperlink{class_qore_1_1_time_zone_a71965bdd73c4d8da8f5bb72d54606ccf}{Time\+Zone\+::get()}} will return the value set for the current \mbox{\hyperlink{class_qore_1_1_program}{Program}}. \begin{DoxyParagraph}{Restrictions\+:} \mbox{\hyperlink{group__parse__options_ga99046cc8285fb26438508cdf29b5771e}{Qore\+::\+PO\+\_\+\+NO\+\_\+\+LOCALE\+\_\+\+CONTROL}} \end{DoxyParagraph} \begin{DoxyParagraph}{Example\+:} \begin{DoxyCode}{0} \DoxyCodeLine{*TimeZone tz = \mbox{\hyperlink{group__threading__functions_gad86831d8ae7b5b1d35e9bb14dc9f6325}{get\_thread\_tz}}();} \DoxyCodeLine{\mbox{\hyperlink{group__threading__functions_ga07fcdce92cacc7cea4b92504a737d7c2}{set\_thread\_tz}}(new TimeZone(\textcolor{stringliteral}{"{}Europe/Prague"{}}));} \DoxyCodeLine{on\_exit \mbox{\hyperlink{group__threading__functions_ga07fcdce92cacc7cea4b92504a737d7c2}{set\_thread\_tz}}(tz);} \end{DoxyCode} \end{DoxyParagraph} \begin{DoxyNote}{Note} The \mbox{\hyperlink{class_qore_1_1_time_zone}{Time\+Zone}} will only be cleared in the current thread in the current \mbox{\hyperlink{class_qore_1_1_program}{Program}} \end{DoxyNote} \begin{DoxySeeAlso}{See also} \begin{DoxyItemize} \item \mbox{\hyperlink{group__threading__functions_ga07fcdce92cacc7cea4b92504a737d7c2}{set\+\_\+thread\+\_\+tz(\+Time\+Zone)}} \item \mbox{\hyperlink{group__threading__functions_gad86831d8ae7b5b1d35e9bb14dc9f6325}{get\+\_\+thread\+\_\+tz()}} \end{DoxyItemize} \end{DoxySeeAlso} \begin{DoxySince}{Since} Qore 0.\+8.\+5 \end{DoxySince} \mbox{\Hypertarget{group__threading__functions_ga07fcdce92cacc7cea4b92504a737d7c2}\label{group__threading__functions_ga07fcdce92cacc7cea4b92504a737d7c2}} \index{Threading Functions@{Threading Functions}!set\_thread\_tz@{set\_thread\_tz}} \index{set\_thread\_tz@{set\_thread\_tz}!Threading Functions@{Threading Functions}} \doxysubsubsection{\texorpdfstring{set\_thread\_tz()}{set\_thread\_tz()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}} {\footnotesize\ttfamily nothing Qore\+::set\+\_\+thread\+\_\+tz (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{class_qore_1_1_time_zone}{Time\+Zone}}}]{zone }\end{DoxyParamCaption})} Sets the default time zone for the current thread. \begin{DoxyParagraph}{Restrictions\+:} \mbox{\hyperlink{group__parse__options_ga99046cc8285fb26438508cdf29b5771e}{Qore\+::\+PO\+\_\+\+NO\+\_\+\+LOCALE\+\_\+\+CONTROL}} \end{DoxyParagraph} \begin{DoxyParams}{Parameters} {\em zone} & the \mbox{\hyperlink{class_qore_1_1_time_zone}{Time\+Zone}} object for the current thread\\ \hline \end{DoxyParams} This will cause the \mbox{\hyperlink{class_qore_1_1_time_zone_a71965bdd73c4d8da8f5bb72d54606ccf}{Time\+Zone\+::get()}} method to return the given \mbox{\hyperlink{class_qore_1_1_time_zone}{Time\+Zone}} when called from the same thread \begin{DoxyParagraph}{Example\+:} \begin{DoxyCode}{0} \DoxyCodeLine{*TimeZone tz = \mbox{\hyperlink{group__threading__functions_gad86831d8ae7b5b1d35e9bb14dc9f6325}{get\_thread\_tz}}();} \DoxyCodeLine{\mbox{\hyperlink{group__threading__functions_ga07fcdce92cacc7cea4b92504a737d7c2}{set\_thread\_tz}}(new TimeZone(\textcolor{stringliteral}{"{}Europe/Prague"{}}));} \DoxyCodeLine{on\_exit \mbox{\hyperlink{group__threading__functions_ga07fcdce92cacc7cea4b92504a737d7c2}{set\_thread\_tz}}(tz);} \end{DoxyCode} \end{DoxyParagraph} \begin{DoxyNote}{Note} The \mbox{\hyperlink{class_qore_1_1_time_zone}{Time\+Zone}} will only be set for the current thread in the current \mbox{\hyperlink{class_qore_1_1_program}{Program}} \end{DoxyNote} \begin{DoxySeeAlso}{See also} \begin{DoxyItemize} \item \mbox{\hyperlink{group__threading__functions_ga07fcdce92cacc7cea4b92504a737d7c2}{set\+\_\+thread\+\_\+tz()}} \item \mbox{\hyperlink{group__threading__functions_gad86831d8ae7b5b1d35e9bb14dc9f6325}{get\+\_\+thread\+\_\+tz()}} \end{DoxyItemize} \end{DoxySeeAlso} \begin{DoxySince}{Since} Qore 0.\+8.\+5 \end{DoxySince} \mbox{\Hypertarget{group__threading__functions_ga113081673d536fc7bae33d2ffe523893}\label{group__threading__functions_ga113081673d536fc7bae33d2ffe523893}} \index{Threading Functions@{Threading Functions}!thread\_list@{thread\_list}} \index{thread\_list@{thread\_list}!Threading Functions@{Threading Functions}} \doxysubsubsection{\texorpdfstring{thread\_list()}{thread\_list()}} {\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga4b52a1cbee7a3aed46c32cb0a938629c}{list}}$<$\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}}$>$ Qore\+::thread\+\_\+list (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})} Returns a list of all current thread IDs. Note that the special signal handling thread with TID 0 is never included in the list returned by this function \begin{DoxyReturn}{Returns} a list of all current thread IDs \end{DoxyReturn} \begin{DoxyParagraph}{Restrictions\+:} \mbox{\hyperlink{group__parse__options_gac379d98e62c57231c2efb7ea87c75a3a}{Qore\+::\+PO\+\_\+\+NO\+\_\+\+THREAD\+\_\+\+INFO}} \end{DoxyParagraph} \begin{DoxyParagraph}{Code Flags\+:} \mbox{\hyperlink{code_flags_RET_VALUE_ONLY}{RET\+\_\+\+VALUE\+\_\+\+ONLY}} \end{DoxyParagraph} \begin{DoxyParagraph}{Example\+:} \begin{DoxyCode}{0} \DoxyCodeLine{list l = \mbox{\hyperlink{group__threading__functions_ga113081673d536fc7bae33d2ffe523893}{thread\_list}}();} \end{DoxyCode} \end{DoxyParagraph} \begin{DoxyNote}{Note} this function is not flagged with \mbox{\hyperlink{code_flags_CONSTANT}{CONSTANT}} since its value could change at runtime \end{DoxyNote} \mbox{\Hypertarget{group__threading__functions_ga23d27aeac0640b070f964f2eb9f1cc8a}\label{group__threading__functions_ga23d27aeac0640b070f964f2eb9f1cc8a}} \index{Threading Functions@{Threading Functions}!thread\_yield@{thread\_yield}} \index{thread\_yield@{thread\_yield}!Threading Functions@{Threading Functions}} \doxysubsubsection{\texorpdfstring{thread\_yield()}{thread\_yield()}} {\footnotesize\ttfamily nothing Qore\+::thread\+\_\+yield (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})} yields the current thread so other threads can be scheduled and run \begin{DoxyParagraph}{Restrictions\+:} \mbox{\hyperlink{group__parse__options_ga10d8e3f76c427b0f974529de572dd0ec}{Qore\+::\+PO\+\_\+\+NO\+\_\+\+PROCESS\+\_\+\+CONTROL}} \end{DoxyParagraph} \begin{DoxyParagraph}{Example\+:} \begin{DoxyCode}{0} \DoxyCodeLine{\mbox{\hyperlink{group__threading__functions_ga23d27aeac0640b070f964f2eb9f1cc8a}{thread\_yield}}();} \end{DoxyCode} \end{DoxyParagraph} \begin{DoxySince}{Since} Qore 0.\+8.\+13 \end{DoxySince} \mbox{\Hypertarget{group__threading__functions_ga421dca39ccb55b191d5d09fd98c2075a}\label{group__threading__functions_ga421dca39ccb55b191d5d09fd98c2075a}} \index{Threading Functions@{Threading Functions}!throw\_thread\_resource\_exceptions@{throw\_thread\_resource\_exceptions}} \index{throw\_thread\_resource\_exceptions@{throw\_thread\_resource\_exceptions}!Threading Functions@{Threading Functions}} \doxysubsubsection{\texorpdfstring{throw\_thread\_resource\_exceptions()}{throw\_thread\_resource\_exceptions()}} {\footnotesize\ttfamily nothing Qore\+::throw\+\_\+thread\+\_\+resource\+\_\+exceptions (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})} Immediately runs all thread resource cleanup routines for the current thread and throws all associated exceptions. This function is particularly useful when used in combination with embedded code in order to catch (and log, for example) thread resource errors (ex\+: uncommitted transactions, unlocked locks, etc) -\/ this can be used when control returns to the \char`\"{}master\char`\"{} program to ensure that no thread-\/local resources have been left active. This function will run all thread resource cleanup routines even if \mbox{\hyperlink{group__threading__functions_gafa1c0f9e429a945b66fb261c7fa1b5bd}{mark\+\_\+thread\+\_\+resources()}} has been called (i.\+e. it clears all marks as well). When exceptions are thrown by this function, thread-\/local resources are also cleaned up at the same time. \begin{DoxyParagraph}{Restrictions\+:} \mbox{\hyperlink{group__parse__options_ga16d8c2b85171b6673b60b5f7d0eaf5eb}{Qore\+::\+PO\+\_\+\+NO\+\_\+\+THREAD\+\_\+\+CONTROL}} \end{DoxyParagraph} \begin{DoxyParagraph}{Example\+:} \begin{DoxyCode}{0} \DoxyCodeLine{\textcolor{keywordflow}{try} \{} \DoxyCodeLine{ \mbox{\hyperlink{group__threading__functions_ga421dca39ccb55b191d5d09fd98c2075a}{throw\_thread\_resource\_exceptions}}();} \DoxyCodeLine{\} catch (hash ex) \{} \DoxyCodeLine{ \textcolor{comment}{\# ... log or handle exceptions}} \DoxyCodeLine{\}} \end{DoxyCode} \end{DoxyParagraph} \begin{DoxyNote}{Note} may not throw an exception even if there are thread resources in place that get cleaned up in case the \mbox{\hyperlink{class_qore_1_1_thread_1_1_abstract_thread_resource_a0431f7384991eaf6900ee3a952b57f87}{Qore\+::\+Thread\+::\+Abstract\+Thread\+Resource\+::cleanup()}} method performs the cleanup but does not throw an exception \end{DoxyNote} \begin{DoxySeeAlso}{See also} \begin{DoxyItemize} \item \mbox{\hyperlink{threading_thread_resources}{Thread Resources}} \item \mbox{\hyperlink{group__threading__functions_gafa1c0f9e429a945b66fb261c7fa1b5bd}{mark\+\_\+thread\+\_\+resources()}} \item \mbox{\hyperlink{group__threading__functions_gadc994316e54fdf50111018de9bd15dc6}{remove\+\_\+thread\+\_\+resource()}} \item \mbox{\hyperlink{group__threading__functions_ga1a1fbc371cfc8885ed78e4bff25d35b1}{set\+\_\+thread\+\_\+resource()}} \item \mbox{\hyperlink{group__threading__functions_ga4e62409b8a1b414276d033267e7299e4}{throw\+\_\+thread\+\_\+resource\+\_\+exceptions\+\_\+to\+\_\+mark()}} \item \mbox{\hyperlink{class_qore_1_1_thread_1_1_abstract_thread_resource}{Abstract\+Thread\+Resource}} \end{DoxyItemize} \end{DoxySeeAlso} \begin{DoxySince}{Since} Qore 0.\+8.\+12 as a replacement for deprecated camel-\/case \mbox{\hyperlink{group__threading__functions_ga401f0e787e79f2e4851d60b9223bb8d2}{throw\+Thread\+Resource\+Exceptions()}} \end{DoxySince} \mbox{\Hypertarget{group__threading__functions_ga4e62409b8a1b414276d033267e7299e4}\label{group__threading__functions_ga4e62409b8a1b414276d033267e7299e4}} \index{Threading Functions@{Threading Functions}!throw\_thread\_resource\_exceptions\_to\_mark@{throw\_thread\_resource\_exceptions\_to\_mark}} \index{throw\_thread\_resource\_exceptions\_to\_mark@{throw\_thread\_resource\_exceptions\_to\_mark}!Threading Functions@{Threading Functions}} \doxysubsubsection{\texorpdfstring{throw\_thread\_resource\_exceptions\_to\_mark()}{throw\_thread\_resource\_exceptions\_to\_mark()}} {\footnotesize\ttfamily bool Qore\+::throw\+\_\+thread\+\_\+resource\+\_\+exceptions\+\_\+to\+\_\+mark (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})} Immediately runs all thread resource cleanup routines for the current thread for thread resources created since the last call to \mbox{\hyperlink{group__threading__functions_gafa1c0f9e429a945b66fb261c7fa1b5bd}{mark\+\_\+thread\+\_\+resources()}} and throws all associated exceptions. When exceptions are thrown by this function, thread-\/local resources are also cleaned up at the same time. \begin{DoxyReturn}{Returns} \mbox{\hyperlink{basic_data_types_True}{True}} if there are additional thread resource marks to process, \mbox{\hyperlink{basic_data_types_False}{False}} if there are no more \end{DoxyReturn} \begin{DoxyParagraph}{Restrictions\+:} \mbox{\hyperlink{group__parse__options_ga16d8c2b85171b6673b60b5f7d0eaf5eb}{Qore\+::\+PO\+\_\+\+NO\+\_\+\+THREAD\+\_\+\+CONTROL}} \end{DoxyParagraph} \begin{DoxyParagraph}{Example\+:} \begin{DoxyCode}{0} \DoxyCodeLine{\textcolor{keywordflow}{try} \{} \DoxyCodeLine{ \mbox{\hyperlink{group__threading__functions_gafa1c0f9e429a945b66fb261c7fa1b5bd}{mark\_thread\_resources}}();} \DoxyCodeLine{ \textcolor{comment}{\# ... some code or calls that may allocate thread resources}} \DoxyCodeLine{} \DoxyCodeLine{ \textcolor{comment}{\# calling the following will ensure that any thread-\/resources allocated since}} \DoxyCodeLine{ \textcolor{comment}{\# the last call to mark\_thread\_resources() will be cleaned up and associated}} \DoxyCodeLine{ \textcolor{comment}{\# exceptions will be thrown}} \DoxyCodeLine{ \mbox{\hyperlink{group__threading__functions_ga4e62409b8a1b414276d033267e7299e4}{throw\_thread\_resource\_exceptions\_to\_mark}}();} \DoxyCodeLine{\} catch (hash< ex) \{} \DoxyCodeLine{ \textcolor{comment}{\# ... log or handle exceptions}} \DoxyCodeLine{\}} \end{DoxyCode} \end{DoxyParagraph} \begin{DoxyNote}{Note} may not throw an exception even if there are thread resources in place that get cleaned up in case the \mbox{\hyperlink{class_qore_1_1_thread_1_1_abstract_thread_resource_a0431f7384991eaf6900ee3a952b57f87}{Qore\+::\+Thread\+::\+Abstract\+Thread\+Resource\+::cleanup()}} method performs the cleanup but does not throw an exception \end{DoxyNote} \begin{DoxySeeAlso}{See also} \begin{DoxyItemize} \item \mbox{\hyperlink{threading_thread_resources}{Thread Resources}} \item \mbox{\hyperlink{group__threading__functions_gafa1c0f9e429a945b66fb261c7fa1b5bd}{mark\+\_\+thread\+\_\+resources()}} \item \mbox{\hyperlink{group__threading__functions_gadc994316e54fdf50111018de9bd15dc6}{remove\+\_\+thread\+\_\+resource()}} \item \mbox{\hyperlink{group__threading__functions_ga1a1fbc371cfc8885ed78e4bff25d35b1}{set\+\_\+thread\+\_\+resource()}} \item \mbox{\hyperlink{group__threading__functions_ga421dca39ccb55b191d5d09fd98c2075a}{throw\+\_\+thread\+\_\+resource\+\_\+exceptions()}} \item \mbox{\hyperlink{class_qore_1_1_thread_1_1_abstract_thread_resource}{Abstract\+Thread\+Resource}} \end{DoxyItemize} \end{DoxySeeAlso} \begin{DoxySince}{Since} Qore 0.\+8.\+4 \end{DoxySince} \mbox{\Hypertarget{group__threading__functions_ga401f0e787e79f2e4851d60b9223bb8d2}\label{group__threading__functions_ga401f0e787e79f2e4851d60b9223bb8d2}} \index{Threading Functions@{Threading Functions}!throwThreadResourceExceptions@{throwThreadResourceExceptions}} \index{throwThreadResourceExceptions@{throwThreadResourceExceptions}!Threading Functions@{Threading Functions}} \doxysubsubsection{\texorpdfstring{throwThreadResourceExceptions()}{throwThreadResourceExceptions()}} {\footnotesize\ttfamily nothing Qore\+::throw\+Thread\+Resource\+Exceptions (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})} Immediately runs all thread resource cleanup routines for the current thread and throws all associated exceptions. \begin{DoxyParagraph}{Restrictions\+:} \mbox{\hyperlink{group__parse__options_ga16d8c2b85171b6673b60b5f7d0eaf5eb}{Qore\+::\+PO\+\_\+\+NO\+\_\+\+THREAD\+\_\+\+CONTROL}} \end{DoxyParagraph} \begin{DoxyParagraph}{Code Flags\+:} \mbox{\hyperlink{code_flags_DEPRECATED}{DEPRECATED}} \end{DoxyParagraph} This function is particularly useful when used in combination with embedded code in order to catch (and log, for example) thread resource errors (ex\+: uncommitted transactions, unlocked locks, etc) -\/ this can be used when control returns to the \char`\"{}master\char`\"{} program to ensure that no thread-\/local resources have been left active. This function will run all thread resource cleanup routines even if \mbox{\hyperlink{group__threading__functions_gafa1c0f9e429a945b66fb261c7fa1b5bd}{mark\+\_\+thread\+\_\+resources()}} has been called (i.\+e. it clears all marks as well). When exceptions are thrown by this function, thread-\/local resources are also cleaned up at the same time. \begin{DoxySeeAlso}{See also} \begin{DoxyItemize} \item \mbox{\hyperlink{threading_thread_resources}{Thread Resources}} \item \mbox{\hyperlink{group__threading__functions_gafa1c0f9e429a945b66fb261c7fa1b5bd}{mark\+\_\+thread\+\_\+resources()}} \item \mbox{\hyperlink{group__threading__functions_gadc994316e54fdf50111018de9bd15dc6}{remove\+\_\+thread\+\_\+resource()}} \item \mbox{\hyperlink{group__threading__functions_ga1a1fbc371cfc8885ed78e4bff25d35b1}{set\+\_\+thread\+\_\+resource()}} \item \mbox{\hyperlink{group__threading__functions_ga421dca39ccb55b191d5d09fd98c2075a}{throw\+\_\+thread\+\_\+resource\+\_\+exceptions()}} \item \mbox{\hyperlink{group__threading__functions_ga4e62409b8a1b414276d033267e7299e4}{throw\+\_\+thread\+\_\+resource\+\_\+exceptions\+\_\+to\+\_\+mark()}} \item \mbox{\hyperlink{class_qore_1_1_thread_1_1_abstract_thread_resource}{Abstract\+Thread\+Resource}} \end{DoxyItemize} \end{DoxySeeAlso} \begin{DoxyRefDesc}{Deprecated} \item[\mbox{\hyperlink{deprecated__deprecated000037}{Deprecated}}]use \mbox{\hyperlink{group__threading__functions_ga421dca39ccb55b191d5d09fd98c2075a}{throw\+\_\+thread\+\_\+resource\+\_\+exceptions()}}; camel-\/case function names were deprecated in Qore 0.\+8.\+12 \end{DoxyRefDesc} ">SqlUtil::AbstractTableprotectedpure virtual uniqueIndexCreatesConstraintImpl()SqlUtil::AbstractTableprotectedpure virtual update(hash< auto > set, hash< auto > cond, reference< string > sql, hash< auto > opt)SqlUtil::AbstractTable update(hash< auto > set, hash< auto > cond, reference< string > sql)SqlUtil::AbstractTable update(hash< auto > set, hash< auto > cond, hash< auto > opt)SqlUtil::AbstractTable update(hash< auto > set, hash< auto > cond)SqlUtil::AbstractTable update(hash< auto > set)SqlUtil::AbstractTable updateCommit(hash< auto > set, hash< auto > cond, reference< string > sql, hash< auto > opt)SqlUtil::AbstractTable updateCommit(hash< auto > set, hash< auto > cond, reference< string > sql)SqlUtil::AbstractTable updateCommit(hash< auto > set, hash< auto > cond, hash< auto > opt)SqlUtil::AbstractTable updateCommit(hash< auto > set, hash< auto > cond)SqlUtil::AbstractTable updateCommit(hash< auto > set)SqlUtil::AbstractTable updateNoCommit(hash< auto > set, *hash< auto > cond, *reference< string > sql)SqlUtil::AbstractTable updateNoCommit(hash< auto > set, *hash< auto > cond, *hash< auto > opt)SqlUtil::AbstractTable updateWithInfo(hash< auto > set, hash< auto > cond, *hash< auto > opt)SqlUtil::AbstractTable upsert(hash< auto > row, int upsert_strategy=UpsertAuto, *hash< auto > opt)SqlUtil::AbstractTable UpsertAutoSqlUtil::AbstractTable upsertCommit(hash< auto > row, int upsert_strategy=UpsertAuto, *hash< auto > opt)SqlUtil::AbstractTable upsertFromIterator(Qore::AbstractIterator i, int upsert_strategy=AbstractTable::UpsertAuto, *hash< auto > opt)SqlUtil::AbstractTableinline upsertFromIteratorCommit(Qore::AbstractIterator i, int upsert_strategy=AbstractTable::UpsertAuto, *hash< auto > opt)SqlUtil::AbstractTableinline upsertFromIteratorNoCommit(Qore::AbstractIterator i, int upsert_strategy=AbstractTable::UpsertAuto, *hash< auto > opt)SqlUtil::AbstractTableinline upsertFromSelect(AbstractTable t, *hash< auto > sh, int upsert_strategy=AbstractTable::UpsertAuto, *hash< auto > opt)SqlUtil::AbstractTableinline upsertFromSelect(Table t, *hash< auto > sh, int upsert_strategy=AbstractTable::UpsertAuto, *hash< auto > opt)SqlUtil::AbstractTableinline upsertFromSelectCommit(AbstractTable t, *hash< auto > sh, int upsert_strategy=AbstractTable::UpsertAuto, *hash< auto > opt)SqlUtil::AbstractTableinline upsertFromSelectCommit(Table t, *hash< auto > sh, int upsert_strategy=AbstractTable::UpsertAuto, *hash< auto > opt)SqlUtil::AbstractTableinline upsertFromSelectNoCommit(AbstractTable t, *hash< auto > sh, int upsert_strategy=AbstractTable::UpsertAuto, *hash< auto > opt)SqlUtil::AbstractTableinline upsertFromSelectNoCommit(Table t, *hash< auto > sh, int upsert_strategy=AbstractTable::UpsertAuto, *hash< auto > opt)SqlUtil::AbstractTableinline UpsertInsertFirstSqlUtil::AbstractTable UpsertInsertOnlySqlUtil::AbstractTable upsertNoCommit(hash< auto > row, int upsert_strategy=UpsertAuto)SqlUtil::AbstractTable UpsertOptionsSqlUtil::AbstractTable UpsertResultDescriptionMapSqlUtil::AbstractTable UpsertResultLetterMapSqlUtil::AbstractTable UpsertResultMapSqlUtil::AbstractTable UpsertSelectFirstSqlUtil::AbstractTable UpsertStrategyDescriptionMapSqlUtil::AbstractTable UpsertStrategyMapSqlUtil::AbstractTable UpsertUpdateFirstSqlUtil::AbstractTable UpsertUpdateOnlySqlUtil::AbstractTable UR_DeletedSqlUtil::AbstractTable UR_InsertedSqlUtil::AbstractTable UR_UnchangedSqlUtil::AbstractTable UR_UpdatedSqlUtil::AbstractTable UR_VerifiedSqlUtil::AbstractTable validateColumnOptions(string cname, reference< hash > opt, bool nullable)SqlUtil::AbstractTableprotected validateHashKeysForWhitespaces(auto node)SqlUtil::AbstractSqlUtilBaseprotected