MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / ServiceThreadMain

Function ServiceThreadMain

modules/piu/PC/piuService.c:333–361  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

331}
332
333txMachine* ServiceThreadMain(void* context)
334{
335 txMachine* root = &ServiceRoot;
336 ServiceThread thread = &MainThread;
337 txPreparation* preparation = xsPreparation();
338
339 //fprintf(stderr, "ServiceThreadMain thread %p\n", thread);
340 c_memset(root, 0, sizeof(txMachine));
341 root->preparation = preparation;
342 root->keyArray = preparation->keys;
343 root->keyCount = (txID)preparation->keyCount + (txID)preparation->creation.initialKeyCount;
344 root->keyIndex = (txID)preparation->keyCount;
345 root->nameModulo = preparation->nameModulo;
346 root->nameTable = preparation->names;
347 root->symbolModulo = preparation->symbolModulo;
348 root->symbolTable = preparation->symbols;
349
350 root->stack = &preparation->stack[0];
351 root->stackBottom = &preparation->stack[0];
352 root->stackTop = &preparation->stack[preparation->stackCount];
353
354 root->firstHeap = &preparation->heap[0];
355 root->freeHeap = &preparation->heap[preparation->heapCount - 1];
356 root->aliasCount = (txID)preparation->aliasCount;
357
358 c_memset(thread, 0, sizeof(ServiceThreadRecord));
359 ServiceThreadInitialize(thread, context);
360 return thread->the;
361}
362
363void ServiceThreadMark(xsMachine* the, void* it, xsMarkRoot markRoot)
364{

Callers 2

WinMainFunction · 0.85

Calls 1

ServiceThreadInitializeFunction · 0.85

Tested by

no test coverage detected