[Lazarus] Set the Highlighter from the source file

Damien Gerard milipili at shikami.org
Mon May 19 13:55:13 CEST 2008


> Hello,
>
> my application uses threads.
> I have created TStringList for data exchange. It is global variable. If
> I receive any data from telnet connection I put it into this string list
> and create thread if is not already created.
> Thread read and delete this data from StringList. If I run my program,
> connect to telnet,  it takes about half hour and program crash with this
> error: Failed to create new thread
> I used to Lazarus 0.9.23cvs and I didnt have problem with it. Problem
> appears after upgrade to 0.9.24 :-(.

I cannot tell if it is the problem, but from a cursory look at the code it
seems that you access this stringlist from various threads with no
synchronization whatsoever, and this is a no-no, since TStringList isn't
threadsafe (or at least I think it isn't, most types, even simple ones,
aren't).
You should protect each access to the stringlist with, e.g., a
TCriticalSection and be careful to avoid deadlocks.

Bye
-- 
Luca



More information about the Lazarus mailing list