13 private static bool s_isLeaseTime =
false;
15 private static bool s_isRenewOnCallTime =
false;
17 private static bool s_isSponsorshipTimeout =
false;
27 private static object s_LifetimeSyncObject =
null;
29 private static object LifetimeSyncObject
33 if (s_LifetimeSyncObject ==
null)
35 object value =
new object();
38 return s_LifetimeSyncObject;
49 return GetTimeSpan(ref s_leaseTimeTicks);
55 lock (LifetimeSyncObject)
61 SetTimeSpan(ref s_leaseTimeTicks, value);
74 return GetTimeSpan(ref s_renewOnCallTimeTicks);
80 lock (LifetimeSyncObject)
82 if (s_isRenewOnCallTime)
86 SetTimeSpan(ref s_renewOnCallTimeTicks, value);
87 s_isRenewOnCallTime =
true;
99 return GetTimeSpan(ref s_sponsorshipTimeoutTicks);
105 lock (LifetimeSyncObject)
107 if (s_isSponsorshipTimeout)
111 SetTimeSpan(ref s_sponsorshipTimeoutTicks, value);
112 s_isSponsorshipTimeout =
true;
124 return GetTimeSpan(ref s_pollTimeTicks);
130 lock (LifetimeSyncObject)
132 SetTimeSpan(ref s_pollTimeTicks, value);
133 if (LeaseManager.IsInitialized())
135 LeaseManager.GetLeaseManager().ChangePollTime(value);
141 private static TimeSpan GetTimeSpan(ref
long ticks)
146 private static void SetTimeSpan(ref
long ticks,
TimeSpan value)
152 [Obsolete(
"Do not create instances of the LifetimeServices class. Call the static methods directly on this type instead",
true)]
162 lease = leaseManager.GetLease(obj);
165 lease = CreateLease(obj);
175 return leaseManager.GetLease(obj);
185 internal static ILease CreateLease(TimeSpan leaseTime, TimeSpan renewOnCallTime, TimeSpan sponsorshipTimeout, MarshalByRefObject obj)
188 return new Lease(leaseTime, renewOnCallTime, sponsorshipTimeout, obj);
Controls the.NET remoting lifetime services.
Describes a set of security permissions applied to code. This class cannot be inherited.
Defines a lifetime lease object that is used by the remoting lifetime service.
static void Write(ref bool location, bool value)
Writes the specified value to the specified field. On systems that require it, inserts a memory barri...
static TimeSpan LeaseTime
Gets or sets the initial lease time span for an T:System.AppDomain.
static TimeSpan FromMilliseconds(double value)
Returns a T:System.TimeSpan that represents a specified number of milliseconds.
static TimeSpan FromMinutes(double value)
Returns a T:System.TimeSpan that represents a specified number of minutes, where the specification is...
long Ticks
Gets the number of ticks that represent the value of the current T:System.TimeSpan structure.
static TimeSpan RenewOnCallTime
Gets or sets the amount of time by which the lease is extended every time a call comes in on the serv...
SecurityAction
Specifies the security actions that can be performed using declarative security.
Provides information about, and means to manipulate, the current environment and platform....
static TimeSpan FromTicks(long value)
Returns a T:System.TimeSpan that represents a specified time, where the specification is in units of ...
static int CompareExchange(ref int location1, int value, int comparand)
Compares two 32-bit signed integers for equality and, if they are equal, replaces the first value.
Contains methods for performing volatile memory operations.
static TimeSpan LeaseManagerPollTime
Gets or sets the time interval between each activation of the lease manager to clean up expired lease...
static bool Read(ref bool location)
Reads the value of the specified field. On systems that require it, inserts a memory barrier that pre...
LifetimeServices()
Creates an instance of T:System.Runtime.Remoting.Lifetime.LifetimeServices.
Represents a time interval.To browse the .NET Framework source code for this type,...
SecurityPermissionFlag
Specifies access flags for the security permission object.
static TimeSpan SponsorshipTimeout
Gets or sets the amount of time the lease manager waits for a sponsor to return with a lease renewal ...
Provides atomic operations for variables that are shared by multiple threads.
The exception that is thrown when something has gone wrong during remoting.
Enables access to objects across application domain boundaries in applications that support remoting.