void ProcessMessage_ThreadsUpdate() { int count = m_readBuffer.ReadInt32(); List <ThreadDetails> threads = new List <ThreadDetails>(); for (int index = 0; index < count; ++index) { LuaValue thread = new LuaValue(m_readBuffer.ReadObjectID(), LuaValueType.THREAD); LuaValue parent = new LuaValue(m_readBuffer.ReadObjectID(), LuaValueType.THREAD); string name = m_readBuffer.ReadString(); int threadid = m_readBuffer.ReadInt32(); string location = m_readBuffer.ReadString(); LuaThreadState state = (LuaThreadState)m_readBuffer.ReadInt32(); int stackSize = m_readBuffer.ReadInt16(); int stackUsed = m_readBuffer.ReadInt16(); double peak = m_readBuffer.ReadNumber(); double average = m_readBuffer.ReadNumber(); bool modified = m_readBuffer.ReadInt16() != 0; bool valid = m_readBuffer.ReadInt16() != 0; ThreadDetails details = new ThreadDetails(thread, parent, name, threadid, location, state, stackSize, stackUsed, peak, average, valid); threads.Add(details); } OnThreadUpdate(new ThreadUpdateEventArgs(threads.ToArray())); }
public ThreadDetails(LuaValue thread, LuaValue parent, string name, int threadid, string location, LuaThreadState state, int stackSize, int stackUsed, double peaktime, double avgtime, bool valid) { m_thread = thread; m_parent = parent; m_name = name; m_threadID = threadid; m_location = location; m_state = state; m_stackSize = stackSize; m_stackUsed = stackUsed; m_peakTime = peaktime; m_averageTime = avgtime; m_valid = valid; }