namespace AsiaINFO.SMS.APPCMPP2
|
{
|
using System;
|
|
internal class ShareData
|
{
|
private static int _activeSeq = 0;
|
private static int _currentISMG = 1;
|
private static uint _seqId = 0;
|
private static object _syncActiveSeqObject = new object();
|
private static object _syncSeqIDLockObject = new object();
|
|
internal static int ActiveSeq
|
{
|
get
|
{
|
lock (_syncActiveSeqObject)
|
{
|
return _activeSeq++;
|
}
|
}
|
set
|
{
|
lock (_syncActiveSeqObject)
|
{
|
_activeSeq = value;
|
}
|
}
|
}
|
|
public static int CurrentISMG
|
{
|
get
|
{
|
return _currentISMG;
|
}
|
}
|
|
internal static uint SeqID
|
{
|
get
|
{
|
lock (_syncSeqIDLockObject)
|
{
|
if ((_seqId + 1) >= uint.MaxValue)
|
{
|
_seqId = 0;
|
}
|
return ++_seqId;
|
}
|
}
|
}
|
}
|
}
|