void OnBuildVertexTaskCallback(BuildVertexRequest request) { RequestUpdateBuffer(request.VertexBuilder, request.Priority); request.Clear(); buildVertexRequestPool.Return(request); }
void ProcessBuildVertexRequests() { ChunkVertexBuilder vertexBuilder; while (vertexBuilderPool.TryBorrow(out vertexBuilder)) { BuildVertexRequest request; if (!buildVertexRequests.TryDequeue(out request)) { vertexBuilderPool.Return(vertexBuilder); break; } request.AttachVertexBuilder(vertexBuilder); ThreadPool.QueueUserWorkItem(buildVertexTask.WaitCallbackMethod, request); } }
void TaskCallback(ChunkTaskRequest request, ChunkTask task) { request.Clear(); requestPool.Return(request); lock (activeRequests) { activeRequests.Remove(request); } }