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

Function fxRunFileThread

xs/tools/xst262.c:1003–1032  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1001unsigned int __stdcall fxRunFileThread(void* it)
1002#else
1003void* fxRunFileThread(void* it)
1004#endif
1005{
1006 txPool* pool = it;
1007 txContext* context;
1008 for (;;) {
1009 fxLockMutex(&(pool->countMutex));
1010 while (pool->count == 0)
1011 fxSleepCondition(&(pool->countCondition), &(pool->countMutex));
1012 if (pool->count > 0) {
1013 context = pool->firstContext;
1014 pool->firstContext = context->next;
1015 pool->count--;
1016 fxWakeAllCondition(&(pool->countCondition));
1017 fxUnlockMutex(&(pool->countMutex));
1018
1019 fxRunContext(pool, context);
1020 c_free(context);
1021 }
1022 else if (pool->count < 0) {
1023 fxUnlockMutex(&(pool->countMutex));
1024 break;
1025 }
1026 }
1027#if mxWindows
1028 return 0;
1029#else
1030 return NULL;
1031#endif
1032}
1033
1034void fxRunContext(txPool* pool, txContext* context)
1035{

Callers

nothing calls this directly

Calls 1

fxRunContextFunction · 0.85

Tested by

no test coverage detected