← back to index

S3889 — "Thread.Resume" and "Thread.Suspend" should not be used

Language: VB.NET  |  Type: BUG  |  Severity: Blocker

Tags: multi-threading, unpredictable

Why is this an issue?

Thread.Suspend and Thread.Resume can give unpredictable results, and both methods have been deprecated. Indeed, if Thread.Suspend is not used very carefully, a thread can be suspended while holding a lock, thus leading to a deadlock.

There are other synchronization mechanisms that are safer and should be used instead, such as:

Resources

Documentation