{"record":{"id":"38530cf346d57402","repo":"Cysharp/UniTask","slug":"emptyqueue","errorCode":null,"errorMessage":"EmptyQueue","messagePattern":"EmptyQueue","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/UniTask/Assets/Plugins/UniTask/Runtime/Internal/MinimumQueue.cs","lineNumber":109,"sourceCode":"            array = newarray;\n            head = 0;\n            tail = (size == capacity) ? 0 : size;\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        void MoveNext(ref int index)\n        {\n            int tmp = index + 1;\n            if (tmp == array.Length)\n            {\n                tmp = 0;\n            }\n            index = tmp;\n        }\n\n        void ThrowForEmptyQueue()\n        {\n            throw new InvalidOperationException(\"EmptyQueue\");\n        }\n    }\n}","sourceCodeStart":91,"sourceCodeEnd":112,"githubUrl":"https://github.com/Cysharp/UniTask/blob/ceac8d6946b1125fe782cd171fbcb245b567dbf9/src/UniTask/Assets/Plugins/UniTask/Runtime/Internal/MinimumQueue.cs#L91-L112","documentation":"Thrown by MinimumQueue.ThrowForEmptyQueue() when Dequeue or Peek is called on a queue with size == 0. MinimumQueue is internal; all legitimate callers (ArrayPool, player-loop runners) check Count before dequeuing. If this fires it indicates a logic bug in the internal consumer or source modification.","triggerScenarios":"Internal: a race condition or invariant violation in ArrayPool's Rent/Return or in ContinuationQueue/PlayerLoopRunner causing a dequeue on an empty queue. Not reachable through normal UniTask public API.","commonSituations":"Not applicable for end users. Would indicate a UniTask internal bug, source modification, or memory corruption.","solutions":["This should not occur in normal usage. Report it as a UniTask issue with a reproduction case.","Verify you are using an unmodified, released version of UniTask.","Check for unsafe memory operations or native plugin interference that could corrupt internal state."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// This is an internal guard not reachable through public API.\n// No user-facing validation is needed.\n// If encountered, report as a UniTask bug.","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use the latest stable UniTask release to benefit from internal bug fixes.","Do not modify UniTask source files — internal invariants may break."],"tags":["internal","data-structure","empty-queue"],"backgroundTag":null,"analyzedSha":"ceac8d6946b1125fe782cd171fbcb245b567dbf9","analyzedAt":"2026-08-13T19:16:39.025Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}