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

Function fxTerminateSharedCluster

xs/sources/xsAtomics.c:746–780  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

744}
745
746void fxTerminateSharedCluster(txMachine* the)
747{
748 if (gxSharedCluster) {
749 #ifdef mxUnscheduleSharedTimer
750 if (the) {
751 txSharedWaiter** address;
752 txSharedWaiter* waiter;
753 mxLockMutex(&gxSharedCluster->waiterMutex);
754 address = &(gxSharedCluster->first);
755 while ((waiter = *address)) {
756 if (waiter->the == the) {
757 *address = waiter->next;
758 if (waiter->timer)
759 mxUnscheduleSharedTimer(waiter->timer);
760 c_free(waiter);
761 }
762 else
763 address = &(waiter->next);
764 }
765 mxUnlockMutex(&gxSharedCluster->waiterMutex);
766 }
767 #endif
768 gxSharedCluster->usage--;
769 if (gxSharedCluster->usage == 0) {
770 #ifdef mxTerminateSharedTimers
771 mxTerminateSharedTimers();
772 #endif
773 #if mxThreads
774 mxDeleteMutex(&gxSharedCluster->waiterMutex);
775 #endif
776 c_free(gxSharedCluster);
777 gxSharedCluster = C_NULL;
778 }
779 }
780}
781
782void* fxCreateSharedChunk(txInteger size)
783{

Callers 1

xst262.cFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected