mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-11-27 16:27:26 +01:00
* when typecasting the result of pthread_self, always call it using
pthread_self(), because it's a procvar under Linux and hence otherwise
the value of the procvar instead of the function result will be
taken (mantis #15821)
git-svn-id: trunk@15049 -
This commit is contained in:
parent
653974f679
commit
4d8f578e4c
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -10316,6 +10316,7 @@ tests/webtbs/tw15777d.pp svneol=native#text/plain
|
|||||||
tests/webtbs/tw15777e.pp svneol=native#text/plain
|
tests/webtbs/tw15777e.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw15777f.pp svneol=native#text/plain
|
tests/webtbs/tw15777f.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw15812.pp svneol=native#text/plain
|
tests/webtbs/tw15812.pp svneol=native#text/plain
|
||||||
|
tests/webtbs/tw15821.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw15843.pp svneol=native#text/plain
|
tests/webtbs/tw15843.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw15909.pp svneol=native#text/plain
|
tests/webtbs/tw15909.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw1592.pp svneol=native#text/plain
|
tests/webtbs/tw1592.pp svneol=native#text/plain
|
||||||
|
|||||||
@ -600,7 +600,7 @@ begin
|
|||||||
{$ifdef has_sem_open}
|
{$ifdef has_sem_open}
|
||||||
{ avoid a potential temporary nameclash with another process/thread }
|
{ avoid a potential temporary nameclash with another process/thread }
|
||||||
str(fpGetPid,semname);
|
str(fpGetPid,semname);
|
||||||
str(ptruint(pthread_self),tid);
|
str(ptruint(pthread_self()),tid);
|
||||||
semname:='/FPC'+semname+'T'+tid+#0;
|
semname:='/FPC'+semname+'T'+tid+#0;
|
||||||
cIntSemaphoreInit:=cIntSemaphoreOpen(@semname[1],initvalue);
|
cIntSemaphoreInit:=cIntSemaphoreOpen(@semname[1],initvalue);
|
||||||
{$else}
|
{$else}
|
||||||
@ -912,7 +912,7 @@ begin
|
|||||||
{$else}
|
{$else}
|
||||||
Result:=LoadPthreads;
|
Result:=LoadPthreads;
|
||||||
{$endif}
|
{$endif}
|
||||||
ThreadID := TThreadID (pthread_self);
|
ThreadID := TThreadID (pthread_self());
|
||||||
{$ifdef DEBUG_MT}
|
{$ifdef DEBUG_MT}
|
||||||
Writeln('InitThreads : ',Result);
|
Writeln('InitThreads : ',Result);
|
||||||
{$endif DEBUG_MT}
|
{$endif DEBUG_MT}
|
||||||
|
|||||||
18
tests/webtbs/tw15821.pp
Normal file
18
tests/webtbs/tw15821.pp
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
{$mode objfpc}{$H+}
|
||||||
|
|
||||||
|
uses
|
||||||
|
{$ifdef unix}
|
||||||
|
cthreads,
|
||||||
|
{$endif}
|
||||||
|
Classes;
|
||||||
|
|
||||||
|
begin
|
||||||
|
writeln('GetThreadID=', ptrint(GetThreadID));
|
||||||
|
writeln('GetCurrentThreadID=', ptrint(GetCurrentThreadId));
|
||||||
|
writeln('MainThreadID=', ptrint(MainThreadID));
|
||||||
|
if (GetThreadID<>GetCurrentThreadID) or
|
||||||
|
(MainThreadID<>GetThreadID) then
|
||||||
|
halt(1);
|
||||||
|
end.
|
||||||
|
|
||||||
|
|
||||||
Loading…
Reference in New Issue
Block a user