Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Abort a suspended thread

Abort a suspended thread

Scheduled Pinned Locked Moved C#
4 Posts 3 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Y Offline
    Y Offline
    yesu prakash
    wrote on last edited by
    #1

    Hi, How can a suspended thread can abort. Thankyou YPKI

    L F 2 Replies Last reply
    0
    • Y yesu prakash

      Hi, How can a suspended thread can abort. Thankyou YPKI

      L Offline
      L Offline
      Luc Pattyn
      wrote on last edited by
      #2

      Hi, According to the documentation and the compiler warnings you must be getting Thread.Suspend is obsolete since .NET 2.0; you should not use it any longer. FWIW: To abort, you should undo the suspension, hence try Thread.Resume first. :)

      Luc Pattyn [Forum Guidelines] [My Articles]


      The quality and detail of your question reflects on the effectiveness of the help you are likely to get. Show formatted code inside PRE tags, and give clear symptoms when describing a problem.


      F 1 Reply Last reply
      0
      • Y yesu prakash

        Hi, How can a suspended thread can abort. Thankyou YPKI

        F Offline
        F Offline
        Fahad Sadah
        wrote on last edited by
        #3

        try
        {
        yourThread.Abort();
        }
        catch (ThreadStateException e)
        {
        yourThread.Resume();
        }

        1 Reply Last reply
        0
        • L Luc Pattyn

          Hi, According to the documentation and the compiler warnings you must be getting Thread.Suspend is obsolete since .NET 2.0; you should not use it any longer. FWIW: To abort, you should undo the suspension, hence try Thread.Resume first. :)

          Luc Pattyn [Forum Guidelines] [My Articles]


          The quality and detail of your question reflects on the effectiveness of the help you are likely to get. Show formatted code inside PRE tags, and give clear symptoms when describing a problem.


          F Offline
          F Offline
          Fahad Sadah
          wrote on last edited by
          #4

          You could undo it after. See my reply.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups