Suspending and Resuming a Thread


In versions of C# prior to 2.0, a thread could be suspended by calling Thread.Suspend( ) and resumed by calling Thread.Resume( ). However, with the release of 2.0, both of these methods have been marked as obsolete and should not be used for new code. The reason is that Suspend( ) is inherently dangerous because it can be used to suspend a thread that is currently holding a lock, thus preventing the lock from being released. This can cause a systemwide problem. You must use C#’s other synchronization features, such as a mutex, to suspend and resume a thread.




C# 2.0(c) The Complete Reference
C# 2.0: The Complete Reference (Complete Reference Series)
ISBN: 0072262095
EAN: 2147483647
Year: 2006
Pages: 300

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net