Qore Programming Language Reference Manual  0.8.13.4
ql_thread.dox.h
1 namespace Qore {
4 
6 struct CallStackInfo {
8  int endline;
10  string file;
12  string function;
14  int line;
16  int offset;
18  string source;
20  string type;
22  int typecode;
23 };
24 };
25 
27 namespace Qore {
32 
34 
44 nothing delete_all_thread_data();
45 
47 
61 nothing delete_thread_data( ...);
62 
64 
78 nothing delete_thread_data(list l);
79 
81 
95 hash<string,list<hash<CallStackInfo>>> getAllThreadCallStacks();
96 
98 
123 hash<string,list<hash<CallStackInfo>>> get_all_thread_call_stacks();
124 
126 
142 
144 
166 list<hash<CallStackInfo>> get_thread_call_stack();
167 
169 
184 auto get_thread_data(string key);
185 
187 
194 nothing get_thread_data();
195 
197 
216 
218 
233 int gettid();
234 
236 
268 nothing mark_thread_resources();
269 
271 
286 int num_threads();
287 
289 
303 *hash remove_thread_data( ...);
304 
306 
321 
323 
345 bool remove_thread_resource(AbstractThreadResource resource);
346 
348 
370 bool remove_thread_resource(code resource);
371 
373 
385 nothing save_thread_data(hash h);
386 
388 
401 nothing save_thread_data(string key, auto value);
402 
404 
411 nothing save_thread_data();
412 
414 
434 bool set_thread_init(*code init);
435 
437 
457 nothing set_thread_resource(AbstractThreadResource resource);
458 
460 
481 nothing set_thread_resource(code resource, auto arg);
482 
484 
506 nothing set_thread_tz(TimeZone zone);
507 
509 
527 nothing set_thread_tz();
528 
530 
547 list<int> thread_list();
548 
550 
560 nothing thread_yield();
561 
563 
587 
589 
621 
623 
659 
661 };
bool remove_thread_resource(AbstractThreadResource resource)
removes a thread resource from the current thread
int line
starting line number
Definition: ql_thread.dox.h:14
nothing mark_thread_resources()
Marks thread resources so that any thread resources left allocated after this call will be cleaned up...
nothing throwThreadResourceExceptions()
Immediately runs all thread resource cleanup routines for the current thread and throws all associate...
nothing set_thread_tz(TimeZone zone)
Sets the default time zone for the current thread.
nothing delete_all_thread_data()
Deletes all keys in the thread-local data hash.
auto get_thread_data(string key)
Returns the value of the thread-local data attached to the key passed.
string type
a type string; either "user", "builtin", "new-thread" or "rethrow" (for rethrown exceptions) ...
Definition: ql_thread.dox.h:20
nothing save_thread_data(hash h)
Saves the data passed in the thread-local hash; all keys are merged into the thread-local hash...
*hash remove_thread_data(...)
Removes the data associated to one or more keys in the thread-local data hash and returns the data re...
list list(...)
Returns an untyped list of the arguments passed at the top level.
int num_threads()
Returns the current number of threads in the process (not including the special signal handling threa...
nothing throw_thread_resource_exceptions()
Immediately runs all thread resource cleanup routines for the current thread and throws all associate...
int typecode
the call type; see Call Type Constants for possible values
Definition: ql_thread.dox.h:22
The TimeZone class provides access to time zone functionality.
Definition: QC_TimeZone.dox.h:6
string file
The parse label of the code; this is normally the file name; this corresponds to the label parameter ...
Definition: ql_thread.dox.h:10
nothing thread_yield()
yields the current thread so other threads can be scheduled and run
hash< string, list< hash< CallStackInfo > > > get_all_thread_call_stacks()
Returns a hash of lists of CallStackInfo hashes keyed by TID (thread ID)
int endline
ending line number
Definition: ql_thread.dox.h:8
string source
An optional source string; if multiple sections of a file were parsed with different parse labels...
Definition: ql_thread.dox.h:18
list< hash< CallStackInfo > > get_thread_call_stack()
Returns a list of CallStackInfo hashes for the current TID (thread ID); because it is always from the...
nothing delete_thread_data(...)
Deletes the data associated to one or more keys in the thread-local data hash; if the data is an obje...
int offset
The line number offset for the "source" key (if known, for user code only)
Definition: ql_thread.dox.h:16
call stack hash description
Definition: ql_thread.dox.h:6
int gettid()
Returns the Qore thread ID (TID) of the current thread.
hash get_all_thread_data()
Returns the entire thread-local data hash.
list< int > thread_list()
Returns a list of all current thread IDs.
bool throw_thread_resource_exceptions_to_mark()
Immediately runs all thread resource cleanup routines for the current thread for thread resources cre...
bool set_thread_init(*code init)
Sets a call reference or closure to run every time a new thread is started.
nothing set_thread_resource(AbstractThreadResource resource)
sets a thread resource for the current thread
main Qore-language namespace
Definition: Pseudo_QC_All.dox.h:2
hash hash(object obj)
Returns a hash of an object&#39;s members.
*TimeZone get_thread_tz()
Returns any TimeZone set for the current thread, NOTHING if none is set.
hash< string, list< hash< CallStackInfo > > > getAllThreadCallStacks()
Returns a hash of lists of CallStackInfo hashes keyed by TID (thread ID)