mirror of
https://github.com/opensim/opensim.git
synced 2026-05-14 10:45:40 +08:00
smartthreadpool: replace its locked dictionary
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
|
||||
using System;
|
||||
using Amib.Threading.Internal;
|
||||
using System;
|
||||
using System.Threading;
|
||||
|
||||
namespace Amib.Threading
|
||||
{
|
||||
@@ -29,19 +30,21 @@ namespace Amib.Threading
|
||||
/// With this variable a thread can know whatever it belongs to a
|
||||
/// SmartThreadPool.
|
||||
/// </summary>
|
||||
private readonly SmartThreadPool _associatedSmartThreadPool;
|
||||
private SmartThreadPool _associatedSmartThreadPool;
|
||||
|
||||
/// <summary>
|
||||
/// A reference to the current work item a thread from the thread pool
|
||||
/// is executing.
|
||||
/// </summary>
|
||||
public WorkItem CurrentWorkItem { get; set; }
|
||||
public Thread WorkThread;
|
||||
|
||||
public ThreadEntry(SmartThreadPool stp)
|
||||
public ThreadEntry(SmartThreadPool stp, Thread th)
|
||||
{
|
||||
_associatedSmartThreadPool = stp;
|
||||
_creationTime = DateTime.UtcNow;
|
||||
_lastAliveTime = DateTime.MinValue;
|
||||
WorkThread = th;
|
||||
}
|
||||
|
||||
public SmartThreadPool AssociatedSmartThreadPool
|
||||
@@ -53,6 +56,12 @@ namespace Amib.Threading
|
||||
{
|
||||
_lastAliveTime = DateTime.UtcNow;
|
||||
}
|
||||
|
||||
public void Clean()
|
||||
{
|
||||
WorkThread = null;
|
||||
_associatedSmartThreadPool = null;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
Reference in New Issue
Block a user