Spicy
Public Member Functions | Public Attributes | List of all members
hilti::rt::Context Struct Reference

#include <context.h>

Public Member Functions

 Context (vthread::ID vid)
 
 Context (const Context &)=delete
 
 Context (Context &&)=delete
 
Contextoperator= (const Context &)=delete
 
Contextoperator= (Context &&)=delete
 

Public Attributes

vthread::ID vid
 
resumable::Handleresumable = nullptr
 
detail::FiberContext fiber
 
std::vector< std::shared_ptr< void > > hilti_globals
 
void * cookie = nullptr
 
uint64_t debug_indent {}
 
const char * source_location {}
 

Detailed Description

Thread execution context. One of these exists per virtual thread, plus one for the main thread.

The type's fields are considered implementation details and shouldn't be accessed or modified by external code.

Constructor & Destructor Documentation

◆ Context()

Context::Context ( vthread::ID  vid)
explicit
Parameters
vidvirtual thread ID of the thread that will use the context

Member Data Documentation

◆ cookie

void* hilti::rt::Context::cookie = nullptr

A user-defined cookie value that's carried around with the context.

◆ debug_indent

uint64_t hilti::rt::Context::debug_indent {}

Current indent level for debug messages.

◆ fiber

detail::FiberContext hilti::rt::Context::fiber

Context-specific state for fiber management.

◆ hilti_globals

std::vector<std::shared_ptr<void> > hilti::rt::Context::hilti_globals

Pointer to an array of (per thread) global variables allocated by the linker code. Each array entry corresponds to the globals of one HILTI module.

◆ resumable

resumable::Handle* hilti::rt::Context::resumable = nullptr

Current resumable if we're inside a fiber so that yielding is supported. Ownership remains with original caller.

◆ source_location

const char* hilti::rt::Context::source_location {}

If non-null, a string describing the most recent source code position.

Use debug::setLocation() to set the current source code location.

◆ vid

vthread::ID hilti::rt::Context::vid

The ID of the virtual thread this context belongs to. vthread::Main for the main thread.


The documentation for this struct was generated from the following files: