Qore Programming Language Reference Manual  1.5.0
ql_thread.dox.h
1 
3 namespace Qore {
5 
7 struct CallStackInfo {
9  int endline;
11  string file;
13  string function;
15  string lang;
17  int line;
19  int offset;
21  *int programid;
23  string source;
27  string type;
29  int typecode;
30 };
31 }
32 
34 namespace Qore {
38 
40 
51 nothing delete_all_thread_data();
52 
54 
71 nothing delete_thread_data( ...);
72 
74 
91 nothing delete_thread_data(list<softstring> l);
92 
94 
104 hash<string,list<hash<CallStackInfo>>> getAllThreadCallStacks();
105 
107 
130 hash<string,list<hash<CallStackInfo>>> get_all_thread_call_stacks();
131 
133 
148 hash<auto> get_all_thread_data();
149 
151 
172 
174 
197 int get_stack_size();
198 
200 
219 list<hash<CallStackInfo>> get_thread_call_stack();
220 
222 
235 auto get_thread_data(string key);
236 
238 
245 nothing get_thread_data();
246 
248 
271 *string get_thread_name();
272 
274 
292 *TimeZone get_thread_tz();
293 
295 
310 int gettid();
311 
313 
344 nothing mark_thread_resources();
345 
347 
362 int num_threads();
363 
365 
380 *hash<auto> remove_thread_data( ...);
381 
383 
398 hash<auto> remove_thread_data(list<softstring> l);
399 
401 
423 bool remove_thread_resource(AbstractThreadResource resource);
424 
426 
448 bool remove_thread_resource(code resource);
449 
451 
465 nothing save_thread_data(hash<auto> h);
466 
468 
483 nothing save_thread_data(string key, auto value);
484 
486 
493 nothing save_thread_data();
494 
496 
516 int set_default_thread_stack_size(int size);
517 
519 
541 bool set_thread_init(*code init);
542 
544 
560 nothing set_thread_name(string name);
561 
563 
583 nothing set_thread_resource(AbstractThreadResource resource);
584 
586 
607 nothing set_thread_resource(code resource, auto arg);
608 
610 
632 nothing set_thread_tz(TimeZone zone);
633 
635 
653 nothing set_thread_tz();
654 
656 
673 list<int> thread_list();
674 
676 
686 nothing thread_yield();
687 
689 
716 
718 
753 
755 
791 
793 }
bool remove_thread_resource(AbstractThreadResource resource)
removes a thread resource from the current thread
int line
starting line number
Definition: ql_thread.dox.h:17
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.
hash< auto > get_all_thread_data()
Returns the entire thread-local data hash.
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.
int set_default_thread_stack_size(int size)
sets the default thread stack size for new threads created after this call and returns the stack size...
int get_default_thread_stack_size()
returns the default thread stack size
string type
a type string; either "user", "builtin", "new-thread" or "rethrow" (for rethrown exceptions) ...
Definition: ql_thread.dox.h:27
string lang
the language of the source code; normally "Qore"
Definition: ql_thread.dox.h:15
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 get_stack_size()
returns the current thread&#39;s stack size
int typecode
the call type; see Call Type Constants for possible values
Definition: ql_thread.dox.h:29
*int programid
related program id (since 0.8.13.7)
Definition: ql_thread.dox.h:21
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:11
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:9
nothing save_thread_data(hash< auto > h)
Saves the data passed in the thread-local hash; all keys are merged into the thread-local hash...
string source
An optional source string; if multiple sections of a file were parsed with different parse labels...
Definition: ql_thread.dox.h:23
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...
*hash< auto > remove_thread_data(...)
Removes the data associated to one or more keys in the thread-local data hash and returns the data re...
int offset
The line number offset for the "source" key (if known, for user code only)
Definition: ql_thread.dox.h:19
call stack hash description
Definition: ql_thread.dox.h:7
int gettid()
Returns the Qore thread ID (TID) of the current thread.
list< int > thread_list()
Returns a list of all current thread IDs.
nothing set_thread_name(string name)
sets the current thread&#39;s descriptive name
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:3
*string get_thread_name()
returns the current thread&#39;s descriptive name if set or NOTHING if not
*TimeZone get_thread_tz()
Returns any TimeZone set for the current thread, NOTHING if none is set.
*int statementid
related statement id (since 0.8.13.7)
Definition: ql_thread.dox.h:25
hash< string, list< hash< CallStackInfo > > > getAllThreadCallStacks()
Returns a hash of lists of CallStackInfo hashes keyed by TID (thread ID)