"Cannot call start on a running or suspended thread" (maybe Indy issue ??) [Edit]

I am placing this question here since -- I think -- it refers to Indy (but maybe not ??)

I have an application that uses a lot of Indy socket components (several TCP servers, and HTTP servers etc.). 

Yesterday, the PC went to sleep while running the application, (probably having some sockets connected). And when I woke up the PC from sleep, I found a modal warning dialog "Cannot call start on a running or suspended thread".

The application was not running in the IDE debugger, and I have never encountered this error before in my application, so I have to do some detective work to try to find the code that could be responsible for this error. I do use threads in my own- written code, but in no case do I call TThread.Start or TThread.Resume, so I guess the error is not in my own threads, and therefore I guess it could be something in the threaded parts of the Indy server components.

Has anyone encountered such error before? (After PC wake from sleep). And/or does anyone have any ideas how I could find the causes? And/or solve it?
--
Regards,
AndrewFG
1
Andrew
10/15/2010 10:26:01 AM
embarcadero.delphi.winsock 1874 articles. 2 followers. Follow

2 Replies
6463 Views

Similar Articles

[PageSpeed] 21
Get it on Google Play
Get it on Apple App Store

Andrew Fiddian-Green wrote:

> Yesterday, the PC went to sleep while running the application,
> (probably having some sockets connected). And when I woke up the PC
> from sleep, I found a modal warning dialog "Cannot call start on a
> running or suspended thread".
> 
> Has anyone encountered such error before? (After PC wake from sleep).
> And/or does anyone have any ideas how I could find the causes? 

Use something like madExcept to find the cause of the Exception.

-- 
Pieter

"To many managers, getting rid of the arrogant, undisciplined,
 over-paid, technology-obsessed, improperly-dressed etc.
 programmers would appear to be a significant added benefit." 
 -- Bjarne Stroustrup The C++ Programming Language 3e, 
    section 24.2.4
0
Pieter
10/16/2010 9:49:48 PM
<Andrew Fiddian-Green> wrote in message 
news:297343@forums.embarcadero.com...

> I am placing this question here since -- I think -- it
> refers to Indy (but maybe not ??)

This likely has nothing to do with Indy itself.

> does anyone have any ideas how I could find the causes?

You will need to look at the debugger's call stack when the error occurs to 
see which thread is failing to be (re)started correctly.

-- 
Remy Lebeau (TeamB)
0
Remy
10/18/2010 5:07:46 PM
Reply: