Added a tiny sleep on assets to stop pegging the CPU
This commit is contained in:
@@ -89,6 +89,7 @@ errorret_t assetRequireLoaded(assetentry_t *entry) {
|
|||||||
|
|
||||||
// Not loaded, just spin the wheel
|
// Not loaded, just spin the wheel
|
||||||
while(entry->state != ASSET_ENTRY_STATE_LOADED) {
|
while(entry->state != ASSET_ENTRY_STATE_LOADED) {
|
||||||
|
usleep(1000);
|
||||||
errorChain(assetUpdate());
|
errorChain(assetUpdate());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -268,6 +269,9 @@ void assetUpdateAsync(thread_t *thread) {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
} while(loading < ASSET.loading + ASSET_LOADING_COUNT_MAX);
|
} while(loading < ASSET.loading + ASSET_LOADING_COUNT_MAX);
|
||||||
|
|
||||||
|
if(threadShouldStop(thread)) break;
|
||||||
|
usleep(1000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user