mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-14 10:09:20 +02:00
* proper error message if the cthreads unit is included too late
uses clause
This commit is contained in:
parent
9fba928b62
commit
d18746bd15
@ -361,6 +361,9 @@ const
|
|||||||
{ assume that this program will not spawn other threads, when the
|
{ assume that this program will not spawn other threads, when the
|
||||||
first thread is started the following constants need to be filled }
|
first thread is started the following constants need to be filled }
|
||||||
IsMultiThread : boolean = FALSE;
|
IsMultiThread : boolean = FALSE;
|
||||||
|
{ set to true, if a threading helper is used before a thread
|
||||||
|
manager has been installed }
|
||||||
|
ThreadingAlreadyUsed : boolean = FALSE;
|
||||||
{ Indicates if there was an error }
|
{ Indicates if there was an error }
|
||||||
StackError : boolean = FALSE;
|
StackError : boolean = FALSE;
|
||||||
InitProc : Pointer = nil;
|
InitProc : Pointer = nil;
|
||||||
@ -769,7 +772,11 @@ const
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.121 2005-02-25 12:34:46 peter
|
Revision 1.122 2005-04-03 19:29:28 florian
|
||||||
|
* proper error message if the cthreads unit is included too late
|
||||||
|
uses clause
|
||||||
|
|
||||||
|
Revision 1.121 2005/02/25 12:34:46 peter
|
||||||
* added HexStr(Pointer)
|
* added HexStr(Pointer)
|
||||||
|
|
||||||
Revision 1.120 2005/02/14 17:13:29 peter
|
Revision 1.120 2005/02/14 17:13:29 peter
|
||||||
|
@ -326,7 +326,9 @@ procedure NoCriticalSection(var CS);
|
|||||||
|
|
||||||
begin
|
begin
|
||||||
if IsMultiThread then
|
if IsMultiThread then
|
||||||
NoThreadError;
|
NoThreadError
|
||||||
|
else
|
||||||
|
ThreadingAlreadyUsed:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure NoInitThreadvar(var offset : dword;size : dword);
|
procedure NoInitThreadvar(var offset : dword;size : dword);
|
||||||
@ -388,14 +390,18 @@ function NORTLEventCreate :PRTLEvent;
|
|||||||
|
|
||||||
begin
|
begin
|
||||||
if IsMultiThread then
|
if IsMultiThread then
|
||||||
NoThreadError;
|
NoThreadError
|
||||||
|
else
|
||||||
|
ThreadingAlreadyUsed:=true
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure NORTLeventdestroy(state:pRTLEvent);
|
procedure NORTLeventdestroy(state:pRTLEvent);
|
||||||
|
|
||||||
begin
|
begin
|
||||||
if IsMultiThread then
|
if IsMultiThread then
|
||||||
NoThreadError;
|
NoThreadError
|
||||||
|
else
|
||||||
|
ThreadingAlreadyUsed:=true
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure NORTLeventSetEvent(state:pRTLEvent);
|
procedure NORTLeventSetEvent(state:pRTLEvent);
|
||||||
@ -469,7 +475,11 @@ end;
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.24 2005-02-26 11:40:38 florian
|
Revision 1.25 2005-04-03 19:29:28 florian
|
||||||
|
* proper error message if the cthreads unit is included too late
|
||||||
|
uses clause
|
||||||
|
|
||||||
|
Revision 1.24 2005/02/26 11:40:38 florian
|
||||||
* rtl event init/destroy throws only an error if it's used in a mult threaded program
|
* rtl event init/destroy throws only an error if it's used in a mult threaded program
|
||||||
|
|
||||||
Revision 1.23 2005/02/25 22:02:46 florian
|
Revision 1.23 2005/02/25 22:02:46 florian
|
||||||
|
@ -623,12 +623,22 @@ end;
|
|||||||
|
|
||||||
|
|
||||||
initialization
|
initialization
|
||||||
|
if ThreadingAlreadyUsed then
|
||||||
|
begin
|
||||||
|
writeln('Threading has been used before cthreads was initialized.');
|
||||||
|
writeln('Make cthreads one of the first units in your uses clause.');
|
||||||
|
runerror(211);
|
||||||
|
end;
|
||||||
SetCThreadManager;
|
SetCThreadManager;
|
||||||
finalization
|
finalization
|
||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.24 2005-02-25 22:10:27 florian
|
Revision 1.25 2005-04-03 19:29:28 florian
|
||||||
|
* proper error message if the cthreads unit is included too late
|
||||||
|
uses clause
|
||||||
|
|
||||||
|
Revision 1.24 2005/02/25 22:10:27 florian
|
||||||
* final fix for linux (hopefully)
|
* final fix for linux (hopefully)
|
||||||
|
|
||||||
Revision 1.23 2005/02/25 22:02:48 florian
|
Revision 1.23 2005/02/25 22:02:48 florian
|
||||||
|
Loading…
Reference in New Issue
Block a user