hoshi-lang dev
Yet another programming language
Loading...
Searching...
No Matches
threading.cpp File Reference
#include "runtime/threading/threading.h"
#include "runtime/memory/memory.h"
#include <cstdint>
#include <errno.h>
#include <pthread.h>
#include <unistd.h>
Include dependency graph for threading.cpp:

Go to the source code of this file.

Classes

struct  ThreadStarterArgs
 

Functions

void * thread_starter_wrapper (void *args)
 
YoiResultUnsignedAndIntObjectruntime_start_thread (YoiVoidCallableInterface *callable)
 
YoiIntegerObjectruntime_thread_join (YoiUnsignedObject *thread_id_obj)
 
uint64_t runtime_get_thread_id ()
 
YoiIntegerObjectruntime_ping_thread (YoiUnsignedObject *thread_id_obj)
 
YoiResultUnsignedAndIntObjectruntime_thread_new_mutex_lock ()
 
void runtime_thread_finalize_mutex_lock (YoiUnsignedObject *handle)
 
void runtime_thread_mutex_lock (YoiUnsignedObject *mutex_handle)
 
void runtime_thread_mutex_unlock (YoiUnsignedObject *mutex_handle)
 
YoiIntegerObjectruntime_thread_mutex_try_lock (YoiUnsignedObject *mutex_handle)
 
YoiResultUnsignedAndIntObjectruntime_thread_new_condition ()
 
void runtime_thread_finalize_condition (YoiUnsignedObject *handle)
 
void runtime_thread_condition_signal (YoiUnsignedObject *condition_handle)
 
void runtime_thread_condition_wait (YoiUnsignedObject *condition_handle, YoiUnsignedObject *mutex_handle)
 
uint64_t runtime_thread_hardware_concurrency ()
 

Function Documentation

◆ runtime_get_thread_id()

uint64_t runtime_get_thread_id ( )

Definition at line 330 of file threading.cpp.

Referenced by hperf_init(), hperf_report_func_enter(), hperf_report_func_leave(), hperf_report_mem_alloc(), hperf_report_mem_free(), and thread_starter_wrapper().

Here is the caller graph for this function:

◆ runtime_ping_thread()

YoiIntegerObject * runtime_ping_thread ( YoiUnsignedObject thread_id_obj)

Definition at line 334 of file threading.cpp.

References YoiUnsignedObject::gc_refcount, runtime_finalize_object(), runtime_object_alloc(), and YoiUnsignedObject::value.

Here is the call graph for this function:

◆ runtime_start_thread()

YoiResultUnsignedAndIntObject * runtime_start_thread ( YoiVoidCallableInterface callable)

Definition at line 285 of file threading.cpp.

References runtime_object_alloc(), and thread_starter_wrapper().

Here is the call graph for this function:

◆ runtime_thread_condition_signal()

void runtime_thread_condition_signal ( YoiUnsignedObject condition_handle)

Definition at line 459 of file threading.cpp.

References YoiUnsignedObject::gc_refcount, runtime_finalize_object(), and YoiUnsignedObject::value.

Here is the call graph for this function:

◆ runtime_thread_condition_wait()

void runtime_thread_condition_wait ( YoiUnsignedObject condition_handle,
YoiUnsignedObject mutex_handle 
)

Definition at line 466 of file threading.cpp.

References YoiUnsignedObject::gc_refcount, runtime_finalize_object(), and YoiUnsignedObject::value.

Here is the call graph for this function:

◆ runtime_thread_finalize_condition()

void runtime_thread_finalize_condition ( YoiUnsignedObject handle)

Definition at line 450 of file threading.cpp.

References YoiUnsignedObject::gc_refcount, runtime_finalize_object(), and YoiUnsignedObject::value.

Here is the call graph for this function:

◆ runtime_thread_finalize_mutex_lock()

void runtime_thread_finalize_mutex_lock ( YoiUnsignedObject handle)

Definition at line 377 of file threading.cpp.

References YoiUnsignedObject::gc_refcount, runtime_finalize_object(), and YoiUnsignedObject::value.

Here is the call graph for this function:

◆ runtime_thread_hardware_concurrency()

uint64_t runtime_thread_hardware_concurrency ( )

Definition at line 479 of file threading.cpp.

◆ runtime_thread_join()

YoiIntegerObject * runtime_thread_join ( YoiUnsignedObject thread_id_obj)

Definition at line 316 of file threading.cpp.

References YoiUnsignedObject::gc_refcount, runtime_finalize_object(), runtime_object_alloc(), and YoiUnsignedObject::value.

Here is the call graph for this function:

◆ runtime_thread_mutex_lock()

void runtime_thread_mutex_lock ( YoiUnsignedObject mutex_handle)

Definition at line 385 of file threading.cpp.

References YoiUnsignedObject::gc_refcount, runtime_finalize_object(), and YoiUnsignedObject::value.

Here is the call graph for this function:

◆ runtime_thread_mutex_try_lock()

YoiIntegerObject * runtime_thread_mutex_try_lock ( YoiUnsignedObject mutex_handle)

Definition at line 399 of file threading.cpp.

References YoiUnsignedObject::gc_refcount, runtime_finalize_object(), runtime_object_alloc(), and YoiUnsignedObject::value.

Here is the call graph for this function:

◆ runtime_thread_mutex_unlock()

void runtime_thread_mutex_unlock ( YoiUnsignedObject mutex_handle)

Definition at line 392 of file threading.cpp.

References YoiUnsignedObject::gc_refcount, runtime_finalize_object(), and YoiUnsignedObject::value.

Here is the call graph for this function:

◆ runtime_thread_new_condition()

YoiResultUnsignedAndIntObject * runtime_thread_new_condition ( )

Definition at line 412 of file threading.cpp.

References runtime_object_alloc().

Here is the call graph for this function:

◆ runtime_thread_new_mutex_lock()

YoiResultUnsignedAndIntObject * runtime_thread_new_mutex_lock ( )

Definition at line 346 of file threading.cpp.

References runtime_object_alloc().

Here is the call graph for this function:

◆ thread_starter_wrapper()

void * thread_starter_wrapper ( void *  args)