1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586
|
<?xml version="1.0" encoding="utf-8"?>
<Type Name="ReaderWriterLock" FullName="System.Threading.ReaderWriterLock">
<TypeSignature Maintainer="auto" Language="C#" Value="public sealed class ReaderWriterLock : System.Runtime.ConstrainedExecution.CriticalFinalizerObject" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi sealed beforefieldinit ReaderWriterLock extends System.Runtime.ConstrainedExecution.CriticalFinalizerObject" />
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyPublicKey>[00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00]</AssemblyPublicKey>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ThreadSafetyStatement>Gtk# is thread aware, but not thread safe; See the <link location="node:gtk-sharp/programming/threads">Gtk# Thread Programming</link> for details.</ThreadSafetyStatement>
<Base>
<BaseTypeName>System.Runtime.ConstrainedExecution.CriticalFinalizerObject</BaseTypeName>
</Base>
<Interfaces />
<Attributes>
<Attribute>
<AttributeName>System.Runtime.InteropServices.ComVisible(true)</AttributeName>
</Attribute>
</Attributes>
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<block subset="none" type="note">
<para>The dnprdnshort has two reader-writer locks, <see cref="T:System.Threading.ReaderWriterLockSlim" /> and <see cref="T:System.Threading.ReaderWriterLock" />. <see cref="T:System.Threading.ReaderWriterLockSlim" /> is recommended for all new development. <see cref="T:System.Threading.ReaderWriterLockSlim" /> is similar to <see cref="T:System.Threading.ReaderWriterLock" />, but it has simplified rules for recursion and for upgrading and downgrading lock state. <see cref="T:System.Threading.ReaderWriterLockSlim" /> avoids many cases of potential deadlock. In addition, the performance of <see cref="T:System.Threading.ReaderWriterLockSlim" /> is significantly better than <see cref="T:System.Threading.ReaderWriterLock" />. </para>
</block>
<para>
<see cref="T:System.Threading.ReaderWriterLock" /> is used to synchronize access to a resource. At any given time, it allows either concurrent read access for multiple threads, or write access for a single thread. In a situation where a resource is changed infrequently, a ReaderWriterLock provides better throughput than a simple one-at-a-time lock, such as <see cref="T:System.Threading.Monitor" />.</para>
<para>ReaderWriterLock works best where most accesses are reads, while writes are infrequent and of short duration. Multiple readers alternate with single writers, so that neither readers nor writers are blocked for long periods.</para>
<block subset="none" type="note">
<para>Holding reader locks or writer locks for long periods will starve other threads. For best performance, consider restructuring your application to minimize the duration of writes.</para>
</block>
<para>A thread can hold a reader lock or a writer lock, but not both at the same time. Instead of releasing a reader lock in order to acquire the writer lock, you can use <see cref="M:System.Threading.ReaderWriterLock.UpgradeToWriterLock(System.Int32)" /> and <see cref="M:System.Threading.ReaderWriterLock.DowngradeFromWriterLock(System.Threading.LockCookie@)" />.</para>
<para>Recursive lock requests increase the lock count on a lock.</para>
<para>Readers and writers are queued separately. When a thread releases the writer lock, all threads waiting in the reader queue at that instant are granted reader locks; when all of those reader locks have been released, the next thread waiting in the writer queue, if any, is granted the writer lock, and so on. In other words, ReaderWriterLock alternates between a collection of readers, and one writer.</para>
<para>While a thread in the writer queue is waiting for active reader locks to be released, threads requesting new reader locks accumulate in the reader queue. Their requests are not granted, even though they could share concurrent access with existing reader-lock holders; this helps protect writers against indefinite blockage by readers.</para>
<para>Most methods for acquiring locks on a ReaderWriterLock accept time-out values. Use time-outs to avoid deadlocks in your application. For example, a thread might acquire the writer lock on one resource and then request a reader lock on a second resource; in the meantime, another thread might acquire the writer lock on the second resource, and request a reader lock on the first. Unless time-outs are used, the threads deadlock.</para>
<para>If the time-out interval expires and the lock request has not been granted, the method returns control to the calling thread by throwing an <see cref="T:System.ApplicationException" />. A thread can catch this exception and determine what action to take next.</para>
<para>Time-outs are expressed in milliseconds. If you use a <see cref="T:System.TimeSpan" /> to specify the time-out, the value used is the total number of whole milliseconds represented by the <see cref="T:System.TimeSpan" />. The following table shows the valid time-out values in milliseconds.</para>
<list type="table">
<listheader>
<item>
<term>
<para>Value </para>
</term>
<description>
<para>Description </para>
</description>
</item>
</listheader>
<item>
<term>
<para>-1 </para>
</term>
<description>
<para>The thread waits until the lock is acquired, regardless of how long it takes. For methods that specify integer time-outs, the constant <see cref="F:System.Threading.Timeout.Infinite" /> can be used. </para>
</description>
</item>
<item>
<term>
<para>0 </para>
</term>
<description>
<para>The thread does not wait to acquire the lock. If the lock cannot be acquired immediately, the method returns. </para>
</description>
</item>
<item>
<term>
<para>>0 </para>
</term>
<description>
<para>The number of milliseconds to wait. </para>
</description>
</item>
</list>
<para>With the exception of -1, negative time-out values are not allowed. If you specify a negative integer other than -1, a time-out value of zero is used instead. (That is, the method returns without waiting, if the lock cannot be acquired immediately.) If you specify a <see cref="T:System.TimeSpan" /> that represents a negative number of milliseconds other than -1, <see cref="T:System.ArgumentOutOfRangeException" /> is thrown.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Defines a lock that supports single writers and multiple readers. </para>
</summary>
</Docs>
<Members>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public ReaderWriterLock ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue />
<Parameters />
<Docs>
<remarks>To be added</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Initializes a new instance of the <see cref="T:System.Threading.ReaderWriterLock" /> class.</para>
</summary>
</Docs>
</Member>
<Member MemberName="AcquireReaderLock">
<MemberSignature Language="C#" Value="public void AcquireReaderLock (int millisecondsTimeout);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void AcquireReaderLock(int32 millisecondsTimeout) cil managed" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="millisecondsTimeout" Type="System.Int32" />
</Parameters>
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>
<see cref="M:System.Threading.ReaderWriterLock.AcquireReaderLock(System.Int32)" /> blocks if a different thread has the writer lock, or if at least one thread is waiting for the writer lock.</para>
<block subset="none" type="note">
<para>If the current thread already has the writer lock, no reader lock is acquired. Instead, the lock count on the writer lock is incremented. This prevents a thread from blocking on its own writer lock. The result is exactly the same as calling <see cref="M:System.Threading.ReaderWriterLock.AcquireWriterLock(System.Int32)" />, and an additional call to <see cref="M:System.Threading.ReaderWriterLock.ReleaseWriterLock" /> is required when releasing the writer lock.</para>
</block>
<para>AcquireReaderLock supports recursive reader-lock requests. That is, a thread can call AcquireReaderLock multiple times, which increments the lock count each time. You must call <see cref="M:System.Threading.ReaderWriterLock.ReleaseReaderLock" /> once for each time you call AcquireReaderLock. Alternatively, you can call <see cref="M:System.Threading.ReaderWriterLock.ReleaseLock" /> to reduce the lock count to zero immediately.</para>
<para>Recursive lock requests are always granted immediately, without placing the requesting thread in the reader queue. Use recursive locks with caution, to avoid blocking writer-lock requests for long periods.</para>
<para>For valid time-out values, see <see cref="T:System.Threading.ReaderWriterLock" />.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Acquires a reader lock, using an <see cref="T:System.Int32" /> value for the time-out.</para>
</summary>
<param name="millisecondsTimeout">
<attribution license="cc4" from="Microsoft" modified="false" />The time-out in milliseconds. </param>
</Docs>
</Member>
<Member MemberName="AcquireReaderLock">
<MemberSignature Language="C#" Value="public void AcquireReaderLock (TimeSpan timeout);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void AcquireReaderLock(valuetype System.TimeSpan timeout) cil managed" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="timeout" Type="System.TimeSpan" />
</Parameters>
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>
<see cref="M:System.Threading.ReaderWriterLock.AcquireReaderLock(System.Int32)" /> blocks if a different thread has the writer lock, or if at least one thread is waiting for the writer lock.</para>
<block subset="none" type="note">
<para>If the current thread already has the writer lock, no reader lock is acquired. Instead, the lock count on the writer lock is incremented. This prevents a thread from blocking on its own writer lock. The result is exactly the same as calling <see cref="M:System.Threading.ReaderWriterLock.AcquireWriterLock(System.Int32)" />, and an additional call to <see cref="M:System.Threading.ReaderWriterLock.ReleaseWriterLock" /> is required when releasing the writer lock.</para>
</block>
<para>AcquireReaderLock supports recursive reader-lock requests. That is, a thread can call AcquireReaderLock multiple times, which increments the lock count each time. You must call <see cref="M:System.Threading.ReaderWriterLock.ReleaseReaderLock" /> once for each time you call AcquireReaderLock. Alternatively, you can call <see cref="M:System.Threading.ReaderWriterLock.ReleaseLock" /> to reduce the lock count to zero immediately.</para>
<para>Recursive lock requests are always granted immediately, without placing the requesting thread in the reader queue. Use recursive locks with caution, to avoid blocking writer-lock requests for long periods.</para>
<para>For valid time-out values, see <see cref="T:System.Threading.ReaderWriterLock" />.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Acquires a reader lock, using a <see cref="T:System.TimeSpan" /> value for the time-out.</para>
</summary>
<param name="timeout">
<attribution license="cc4" from="Microsoft" modified="false" />A TimeSpan specifying the time-out period. </param>
</Docs>
</Member>
<Member MemberName="AcquireWriterLock">
<MemberSignature Language="C#" Value="public void AcquireWriterLock (int millisecondsTimeout);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void AcquireWriterLock(int32 millisecondsTimeout) cil managed" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="millisecondsTimeout" Type="System.Int32" />
</Parameters>
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>This method blocks if another thread has a reader lock or writer lock. For a description of the way the writer lock alternates with multiple concurrent reader locks, see the <see cref="T:System.Threading.ReaderWriterLock" /> class.</para>
<para>A thread that already has a reader lock can acquire the writer lock in one of two ways: by releasing the reader lock before calling <see cref="M:System.Threading.ReaderWriterLock.AcquireWriterLock(System.Int32)" />, or by calling <see cref="M:System.Threading.ReaderWriterLock.UpgradeToWriterLock(System.Int32)" />.</para>
<block subset="none" type="note">
<para>If a thread calls AcquireWriterLock while it still has a reader lock, it will block on its own reader lock; if an infinite time-out is specified, the thread will deadlock. To avoid such deadlocks, use <see cref="P:System.Threading.ReaderWriterLock.IsReaderLockHeld" /> to determine whether the current thread already has a reader lock.</para>
</block>
<para>AcquireWriterLock supports recursive writer-lock requests. That is, a thread can call AcquireWriterLock multiple times, which increments the lock count each time. You must call <see cref="M:System.Threading.ReaderWriterLock.ReleaseWriterLock" /> once for each time you call AcquireWriterLock. Alternatively, you can call <see cref="M:System.Threading.ReaderWriterLock.ReleaseLock" /> to reduce the lock count to zero immediately.</para>
<para>Recursive lock requests are always granted immediately, without placing the requesting thread in the writer queue.</para>
<para>For valid time-out values, see <see cref="T:System.Threading.ReaderWriterLock" />.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Acquires the writer lock, using an <see cref="T:System.Int32" /> value for the time-out.</para>
</summary>
<param name="millisecondsTimeout">
<attribution license="cc4" from="Microsoft" modified="false" />The time-out in milliseconds. </param>
</Docs>
</Member>
<Member MemberName="AcquireWriterLock">
<MemberSignature Language="C#" Value="public void AcquireWriterLock (TimeSpan timeout);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void AcquireWriterLock(valuetype System.TimeSpan timeout) cil managed" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="timeout" Type="System.TimeSpan" />
</Parameters>
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>This method blocks if another thread has a reader lock or writer lock. For a description of the way the writer lock alternates with multiple concurrent reader locks, see the <see cref="T:System.Threading.ReaderWriterLock" /> class.</para>
<para>A thread that already has a reader lock can acquire the writer lock in one of two ways: by releasing the reader lock before calling <see cref="M:System.Threading.ReaderWriterLock.AcquireWriterLock(System.Int32)" />, or by calling <see cref="M:System.Threading.ReaderWriterLock.UpgradeToWriterLock(System.Int32)" />.</para>
<block subset="none" type="note">
<para>If a thread calls AcquireWriterLock while it still has a reader lock, it will block on its own reader lock; if an infinite time-out is specified, the thread will deadlock. To avoid such deadlocks, use <see cref="P:System.Threading.ReaderWriterLock.IsReaderLockHeld" /> to determine whether the current thread already has a reader lock.</para>
</block>
<para>AcquireWriterLock supports recursive writer-lock requests. That is, a thread can call AcquireWriterLock multiple times, which increments the lock count each time. You must call <see cref="M:System.Threading.ReaderWriterLock.ReleaseWriterLock" /> once for each time you call AcquireWriterLock. Alternatively, you can call <see cref="M:System.Threading.ReaderWriterLock.ReleaseLock" /> to reduce the lock count to zero immediately.</para>
<para>Recursive lock requests are always granted immediately, without placing the requesting thread in the writer queue.</para>
<para>For valid time-out values, see <see cref="T:System.Threading.ReaderWriterLock" />.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Acquires the writer lock, using a <see cref="T:System.TimeSpan" /> value for the time-out.</para>
</summary>
<param name="timeout">
<attribution license="cc4" from="Microsoft" modified="false" />The TimeSpan specifying the time-out period. </param>
</Docs>
</Member>
<Member MemberName="AnyWritersSince">
<MemberSignature Language="C#" Value="public bool AnyWritersSince (int seqNum);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance bool AnyWritersSince(int32 seqNum) cil managed" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="seqNum" Type="System.Int32" />
</Parameters>
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>You can use <see cref="P:System.Threading.ReaderWriterLock.WriterSeqNum" /> and AnyWritersSince to improve application performance. For example, a thread might cache the information it obtains while holding a reader lock. After releasing and later reacquiring the lock, the thread can use AnyWritersSince to determine whether other threads have written to the resource in the interim; if not, the cached information can be used. This technique is useful where reading the information protected by the lock is expensive; for example, running a database query.</para>
<para>The caller must be holding a reader lock or a writer lock in order for the sequence number to be useful.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Indicates whether the writer lock has been granted to any thread since the sequence number was obtained.</para>
</summary>
<returns>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>true if the writer lock has been granted to any thread since the sequence number was obtained; otherwise, false.</para>
</returns>
<param name="seqNum">
<attribution license="cc4" from="Microsoft" modified="false" />The sequence number. </param>
</Docs>
</Member>
<Member MemberName="DowngradeFromWriterLock">
<MemberSignature Language="C#" Value="public void DowngradeFromWriterLock (ref System.Threading.LockCookie lockCookie);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void DowngradeFromWriterLock(valuetype System.Threading.LockCookie lockCookie) cil managed" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="lockCookie" Type="System.Threading.LockCookie&" RefType="ref" />
</Parameters>
<Docs>
<param name="lockCookie">To be added: an object of type 'LockCookie&'</param>
<summary>To be added</summary>
<remarks>To be added</remarks>
</Docs>
</Member>
<Member MemberName="Finalize">
<MemberSignature Language="C#" Value="~ReaderWriterLock ();" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig virtual instance void Finalize() cil managed" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>To be added.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="IsReaderLockHeld">
<MemberSignature Language="C#" Value="public bool IsReaderLockHeld { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool IsReaderLockHeld" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>get: System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.Success)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<value>To be added: an object of type 'bool'</value>
<remarks>To be added</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Gets a value indicating whether the current thread holds a reader lock.</para>
</summary>
</Docs>
</Member>
<Member MemberName="IsWriterLockHeld">
<MemberSignature Language="C#" Value="public bool IsWriterLockHeld { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool IsWriterLockHeld" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>get: System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.Success)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<value>To be added: an object of type 'bool'</value>
<remarks>To be added</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Gets a value indicating whether the current thread holds the writer lock.</para>
</summary>
</Docs>
</Member>
<Member MemberName="ReleaseLock">
<MemberSignature Language="C#" Value="public System.Threading.LockCookie ReleaseLock ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance valuetype System.Threading.LockCookie ReleaseLock() cil managed" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Threading.LockCookie</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>
<see cref="M:System.Threading.ReaderWriterLock.ReleaseLock" /> releases the reader lock or writer lock, regardless of the recursive lock count. To restore the state of the lock, including the lock count, pass the <see cref="T:System.Threading.LockCookie" /> to <see cref="M:System.Threading.ReaderWriterLock.RestoreLock(System.Threading.LockCookie@)" />.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Releases the lock, regardless of the number of times the thread acquired the lock.</para>
</summary>
<returns>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>A <see cref="T:System.Threading.LockCookie" /> value representing the released lock.</para>
</returns>
</Docs>
</Member>
<Member MemberName="ReleaseReaderLock">
<MemberSignature Language="C#" Value="public void ReleaseReaderLock ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void ReleaseReaderLock() cil managed" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.Success)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>
<see cref="M:System.Threading.ReaderWriterLock.ReleaseReaderLock" /> decrements the lock count. When the count reaches zero, the lock is released.</para>
<block subset="none" type="note">
<para>If a thread has the writer lock, calling ReleaseReaderLock has the same effect as calling <see cref="M:System.Threading.ReaderWriterLock.ReleaseWriterLock" />. If a thread has no locks, calling ReleaseReaderLock throws an <see cref="T:System.ApplicationException" />.</para>
</block>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Decrements the lock count.</para>
</summary>
</Docs>
</Member>
<Member MemberName="ReleaseWriterLock">
<MemberSignature Language="C#" Value="public void ReleaseWriterLock ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void ReleaseWriterLock() cil managed" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.Success)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>
<see cref="M:System.Threading.ReaderWriterLock.ReleaseWriterLock" /> decrements the writer lock count. When the count reaches zero, the writer lock is released.</para>
<block subset="none" type="note">
<para>If a thread has a reader lock, or no locks, calling ReleaseWriterLock throws an <see cref="T:System.ApplicationException" />.</para>
</block>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Decrements the lock count on the writer lock.</para>
</summary>
</Docs>
</Member>
<Member MemberName="RestoreLock">
<MemberSignature Language="C#" Value="public void RestoreLock (ref System.Threading.LockCookie lockCookie);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void RestoreLock(valuetype System.Threading.LockCookie lockCookie) cil managed" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="lockCookie" Type="System.Threading.LockCookie&" RefType="ref" />
</Parameters>
<Docs>
<param name="lockCookie">To be added: an object of type 'LockCookie&'</param>
<summary>To be added</summary>
<remarks>To be added</remarks>
</Docs>
</Member>
<Member MemberName="UpgradeToWriterLock">
<MemberSignature Language="C#" Value="public System.Threading.LockCookie UpgradeToWriterLock (int millisecondsTimeout);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance valuetype System.Threading.LockCookie UpgradeToWriterLock(int32 millisecondsTimeout) cil managed" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Threading.LockCookie</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="millisecondsTimeout" Type="System.Int32" />
</Parameters>
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>When a thread calls UpgradeToWriterLock the reader lock is released, regardless of the lock count, and the thread goes to the end of the queue for the writer lock. Thus, other threads might write to the resource before the thread that requested the upgrade is granted the writer lock.</para>
<block subset="none" type="note">
<para>The time-out exception is not thrown until the thread that called the <see cref="M:System.Threading.ReaderWriterLock.UpgradeToWriterLock(System.Int32)" /> method can reacquire the reader lock. If there are no other threads waiting for the writer lock, this happens immediately. However, if another thread is queued for the writer lock, the thread that called the <see cref="M:System.Threading.ReaderWriterLock.UpgradeToWriterLock(System.Int32)" /> method cannot reacquire the reader lock until all current readers have released their locks, and one thread has acquired and released the writer lock. This is true even if the other thread that requested the writer lock requested it after the current thread called the <see cref="M:System.Threading.ReaderWriterLock.UpgradeToWriterLock(System.Int32)" /> method.</para>
</block>
<para>To restore the lock state, call <see cref="M:System.Threading.ReaderWriterLock.DowngradeFromWriterLock(System.Threading.LockCookie@)" /> using the <see cref="T:System.Threading.LockCookie" /> returned by UpgradeToWriterLock. Do not use this LockCookie with <see cref="M:System.Threading.ReaderWriterLock.RestoreLock(System.Threading.LockCookie@)" />.</para>
<para>When a thread has no reader lock, do not use UpgradeToWriterLock. Use <see cref="M:System.Threading.ReaderWriterLock.AcquireWriterLock(System.Int32)" /> instead.</para>
<para>For valid time-out values, see <see cref="T:System.Threading.ReaderWriterLock" />.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Upgrades a reader lock to the writer lock, using an Int32 value for the time-out.</para>
</summary>
<returns>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>A <see cref="T:System.Threading.LockCookie" /> value.</para>
</returns>
<param name="millisecondsTimeout">
<attribution license="cc4" from="Microsoft" modified="false" />The time-out in milliseconds. </param>
</Docs>
</Member>
<Member MemberName="UpgradeToWriterLock">
<MemberSignature Language="C#" Value="public System.Threading.LockCookie UpgradeToWriterLock (TimeSpan timeout);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance valuetype System.Threading.LockCookie UpgradeToWriterLock(valuetype System.TimeSpan timeout) cil managed" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Threading.LockCookie</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="timeout" Type="System.TimeSpan" />
</Parameters>
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>When a thread calls UpgradeToWriterLock the reader lock is released, regardless of the lock count, and the thread goes to the end of the queue for the writer lock. Thus, other threads might write to the resource before the thread that requested the upgrade is granted the writer lock.</para>
<block subset="none" type="note">
<para>The time-out exception is not thrown until the thread that called the <see cref="M:System.Threading.ReaderWriterLock.UpgradeToWriterLock(System.Int32)" /> method can reacquire the reader lock. If there are no other threads waiting for the writer lock, this happens immediately. However, if another thread is queued for the writer lock, the thread that called the <see cref="M:System.Threading.ReaderWriterLock.UpgradeToWriterLock(System.Int32)" /> method cannot reacquire the reader lock until all current readers have released their locks, and one thread has acquired and released the writer lock. This is true even if the other thread that requested the writer lock requested it after the current thread called the <see cref="M:System.Threading.ReaderWriterLock.UpgradeToWriterLock(System.Int32)" /> method.</para>
</block>
<para>To restore the lock state, call <see cref="M:System.Threading.ReaderWriterLock.DowngradeFromWriterLock(System.Threading.LockCookie@)" /> using the <see cref="T:System.Threading.LockCookie" /> returned by UpgradeToWriterLock. Do not use this LockCookie with <see cref="M:System.Threading.ReaderWriterLock.RestoreLock(System.Threading.LockCookie@)" />.</para>
<para>When a thread has no reader lock, do not use UpgradeToWriterLock. Use <see cref="M:System.Threading.ReaderWriterLock.AcquireWriterLock(System.Int32)" /> instead.</para>
<para>For valid time-out values, see <see cref="T:System.Threading.ReaderWriterLock" />.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Upgrades a reader lock to the writer lock, using a TimeSpan value for the time-out.</para>
</summary>
<returns>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>A <see cref="T:System.Threading.LockCookie" /> value.</para>
</returns>
<param name="timeout">
<attribution license="cc4" from="Microsoft" modified="false" />The TimeSpan specifying the time-out period. </param>
</Docs>
</Member>
<Member MemberName="WriterSeqNum">
<MemberSignature Language="C#" Value="public int WriterSeqNum { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance int32 WriterSeqNum" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Docs>
<value>To be added: an object of type 'int'</value>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>The sequence number increases whenever a thread acquires the writer lock. You can save the sequence number and pass it to <see cref="M:System.Threading.ReaderWriterLock.AnyWritersSince(System.Int32)" /> at a later time, if you want to determine whether other threads have acquired the writer lock in the meantime.</para>
<para>You can use WriterSeqNum to improve application performance. For example, a thread might cache the information it obtains while holding a reader lock. After releasing and later reacquiring the lock, the thread can determine whether other threads have written to the resource by calling AnyWritersSince; if not, the cached information can be used. This technique is useful when reading the information protected by the lock is expensive; for example, running a database query.</para>
<para>The caller must be holding a reader lock or a writer lock in order for the sequence number to be useful.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Gets the current sequence number.</para>
</summary>
</Docs>
</Member>
</Members>
</Type>
|