GraalvmPthreadManager

class GraalvmPthreadManager(memory: Memory, dynamicMemory: DynamicMemory, externalManagedThreadStartRoutine: () -> IndirectFunctionTableIndex, managedThreadInitializer: ManagedThreadInitializer, indirectFunctionBindingProvider: IndirectFunctionBindingProvider, emscriptenPthreadInternal: EmscriptenPthreadInternal, emscriptenPthread: EmscriptenPthread, mainThreadId: Long = Thread.currentThread().id, rootLogger: Logger) : PthreadManager(source)

Constructors

Link copied to clipboard
constructor(memory: Memory, dynamicMemory: DynamicMemory, externalManagedThreadStartRoutine: () -> IndirectFunctionTableIndex, managedThreadInitializer: ManagedThreadInitializer, indirectFunctionBindingProvider: IndirectFunctionBindingProvider, emscriptenPthreadInternal: EmscriptenPthreadInternal, emscriptenPthread: EmscriptenPthread, mainThreadId: Long = Thread.currentThread().id, rootLogger: Logger)

Functions

Link copied to clipboard
fun createWasmPthreadForThread(thread: Thread): pthread_t
Link copied to clipboard
fun joinThreads(maxTimeout: Duration = MAX_JOIN_THREADS_TIMEOUT)
Link copied to clipboard
fun spawnThread(pthreadPtr: WasmPtr, attr: WasmPtr, startRoutine: Int, arg: WasmPtr): Int

Called from __pthread_create_js to reuse an existing Web Worker or spawn a new one

Link copied to clipboard
fun unregisterManagedThread(pthreadPtr: WasmPtr, thread: Thread, throwable: Throwable? = null)