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

Function fxInitializeSharedCluster

xs/sources/xsAtomics.c:726–744  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

724txSharedCluster* gxSharedCluster = C_NULL;
725
726void fxInitializeSharedCluster(txMachine* the)
727{
728 if (gxSharedCluster) {
729 gxSharedCluster->usage++;
730 }
731 else {
732 gxSharedCluster = c_calloc(sizeof(txSharedCluster), 1);
733 if (gxSharedCluster) {
734 gxSharedCluster->mainThread = mxCurrentThread();
735 gxSharedCluster->usage++;
736 #if mxThreads
737 mxCreateMutex(&gxSharedCluster->waiterMutex);
738 #endif
739 #ifdef mxInitializeSharedTimers
740 mxInitializeSharedTimers();
741 #endif
742 }
743 }
744}
745
746void fxTerminateSharedCluster(txMachine* the)
747{

Callers 1

xst262.cFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected