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. Managed C++/CLI
  4. Aborting a Thread:; won't leave AbortRequested state

Aborting a Thread:; won't leave AbortRequested state

Scheduled Pinned Locked Moved Managed C++/CLI
csharphelpvisual-studiotutorialquestion
1 Posts 1 Posters 0 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.
  • J Offline
    J Offline
    jblau
    wrote on last edited by
    #1

    I am using Visual Studio.Net 2003 My mainThread creates a newThread and the newThread starts doing its thing. At some point the newThread suspends itself; at which point it enters the ThreadState of Suspended. I am trying to abort the newTread from my mainThread. When i attempt this using a newThread->abort(); It throws a ThreadStateException, i beleive because the newThread is suspended. At this point the ThreadState of newThread is (SuspendRequested, AbortRequested). So in the ThreadStateException catch, i use a newThread->Resume(); This causes the threadState of newThread to be simply (AbortRequested). The problem is that I can't figure out how to get the newThread to leave AbortRequested state and enter the Stopped state. If I call the abort from within newThread, it enters the Stopped state without problem; why can't I abort the newThread from within mainThread? any help would be appreciated, Thanks, Jody Blau

    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