Ejemplo n.º 1
0
        void OnBuildVertexTaskCallback(BuildVertexRequest request)
        {
            RequestUpdateBuffer(request.VertexBuilder, request.Priority);

            request.Clear();
            buildVertexRequestPool.Return(request);
        }
Ejemplo n.º 2
0
        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);
            }
        }
Ejemplo n.º 3
0
        void TaskCallback(ChunkTaskRequest request, ChunkTask task)
        {
            request.Clear();
            requestPool.Return(request);

            lock (activeRequests)
            {
                activeRequests.Remove(request);
            }
        }