mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-16 12:19:18 +02:00
* refactored definition of pthread_mutex_t into single location
(pmutext.inc) like for *BSD; fixes the definition of TRTLCriticalSection for MIPS (and AArch64, as found by Edmund Grimley Evans) git-svn-id: trunk@30875 -
This commit is contained in:
parent
0a1b851b5c
commit
23254e7ce2
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -8715,6 +8715,7 @@ rtl/linux/osdefs.inc svneol=native#text/plain
|
|||||||
rtl/linux/osmacro.inc svneol=native#text/plain
|
rtl/linux/osmacro.inc svneol=native#text/plain
|
||||||
rtl/linux/ossysc.inc svneol=native#text/plain
|
rtl/linux/ossysc.inc svneol=native#text/plain
|
||||||
rtl/linux/ostypes.inc svneol=native#text/plain
|
rtl/linux/ostypes.inc svneol=native#text/plain
|
||||||
|
rtl/linux/pmutext.inc svneol=native#text/plain
|
||||||
rtl/linux/powerpc/bsyscall.inc svneol=native#text/plain
|
rtl/linux/powerpc/bsyscall.inc svneol=native#text/plain
|
||||||
rtl/linux/powerpc/cprt0.as svneol=native#text/plain
|
rtl/linux/powerpc/cprt0.as svneol=native#text/plain
|
||||||
rtl/linux/powerpc/dllprt0.as svneol=native#text/plain
|
rtl/linux/powerpc/dllprt0.as svneol=native#text/plain
|
||||||
|
56
rtl/linux/pmutext.inc
Normal file
56
rtl/linux/pmutext.inc
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
{
|
||||||
|
This file is part of the Free Pascal run time library.
|
||||||
|
Copyright (c) 1999-2000 by Peter Vreman
|
||||||
|
member of the Free Pascal development team.
|
||||||
|
|
||||||
|
See the file COPYING.FPC, included in this distribution,
|
||||||
|
for details about the copyright.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
|
||||||
|
**********************************************************************}
|
||||||
|
|
||||||
|
{ definition of pthread_mutex_t, because needed in both ptypes.inc and }
|
||||||
|
{ in sysosh.inc }
|
||||||
|
|
||||||
|
{ use a macro rather than a constant, so this name doesn't get exported
|
||||||
|
from the system unit interface; macro's have to be on at this point
|
||||||
|
because they're use to propagate the MUTEXTYPENAME here }
|
||||||
|
|
||||||
|
{$ifdef CPUMIPS}
|
||||||
|
{$define USE_PTHREAD_SIZEOF}
|
||||||
|
|
||||||
|
{$ifdef CPU64}
|
||||||
|
{$define __SIZEOF_PTHREAD_MUTEX_T := 40}
|
||||||
|
{$else CPU64}
|
||||||
|
{$define __SIZEOF_PTHREAD_MUTEX_T := 24}
|
||||||
|
{$endif CPU64}
|
||||||
|
|
||||||
|
{$endif MIPS}
|
||||||
|
|
||||||
|
MUTEXTYPENAME = record
|
||||||
|
case byte of
|
||||||
|
{$ifdef USE_PTHREAD_SIZEOF}
|
||||||
|
0 : (
|
||||||
|
__size : array[0..__SIZEOF_PTHREAD_MUTEX_T-1] of char;
|
||||||
|
__align : sizeint;
|
||||||
|
);
|
||||||
|
{$endif}
|
||||||
|
1 : (
|
||||||
|
__m_reserved: longint;
|
||||||
|
__m_count: longint;
|
||||||
|
__m_owner: pointer;
|
||||||
|
__m_kind: longint;
|
||||||
|
__m_lock: record
|
||||||
|
__status: sizeint;
|
||||||
|
__spinlock: longint;
|
||||||
|
end;
|
||||||
|
);
|
||||||
|
end;
|
||||||
|
|
||||||
|
{$ifdef __SIZEOF_PTHREAD_MUTEX_T}
|
||||||
|
{$undef __SIZEOF_PTHREAD_MUTEX_T}
|
||||||
|
{$endif __SIZEOF_PTHREAD_MUTEX_T}
|
||||||
|
{$macro off}
|
@ -35,7 +35,6 @@ introduction)
|
|||||||
{$ifdef CPU64}
|
{$ifdef CPU64}
|
||||||
const
|
const
|
||||||
__SIZEOF_PTHREAD_ATTR_T = 56;
|
__SIZEOF_PTHREAD_ATTR_T = 56;
|
||||||
__SIZEOF_PTHREAD_MUTEX_T = 40;
|
|
||||||
__SIZEOF_PTHREAD_MUTEXATTR_T = 4;
|
__SIZEOF_PTHREAD_MUTEXATTR_T = 4;
|
||||||
__SIZEOF_PTHREAD_COND_T = 48;
|
__SIZEOF_PTHREAD_COND_T = 48;
|
||||||
__SIZEOF_PTHREAD_CONDATTR_T = 4;
|
__SIZEOF_PTHREAD_CONDATTR_T = 4;
|
||||||
@ -46,7 +45,6 @@ const
|
|||||||
{$else : not CPU64, i.e. CPU32}
|
{$else : not CPU64, i.e. CPU32}
|
||||||
const
|
const
|
||||||
__SIZEOF_PTHREAD_ATTR_T = 36;
|
__SIZEOF_PTHREAD_ATTR_T = 36;
|
||||||
__SIZEOF_PTHREAD_MUTEX_T = 24;
|
|
||||||
__SIZEOF_PTHREAD_MUTEXATTR_T = 4;
|
__SIZEOF_PTHREAD_MUTEXATTR_T = 4;
|
||||||
__SIZEOF_PTHREAD_COND_T = 48;
|
__SIZEOF_PTHREAD_COND_T = 48;
|
||||||
__SIZEOF_PTHREAD_CONDATTR_T = 4;
|
__SIZEOF_PTHREAD_CONDATTR_T = 4;
|
||||||
@ -245,24 +243,11 @@ Type
|
|||||||
__spinlock: cint;
|
__spinlock: cint;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
pthread_mutex_t = record
|
{$macro on}
|
||||||
{$ifdef USE_PTHREAD_SIZEOF}
|
{$define MUTEXTYPENAME := pthread_mutex_t}
|
||||||
case byte of
|
{$i pmutext.inc}
|
||||||
0 : (
|
{$undef MUTEXTYPENAME}
|
||||||
__size : array[0..__SIZEOF_PTHREAD_MUTEX_T-1] of char;
|
{$macro off}
|
||||||
__align : clong;
|
|
||||||
);
|
|
||||||
1 : (
|
|
||||||
{$endif}
|
|
||||||
__m_reserved: cint;
|
|
||||||
__m_count: cint;
|
|
||||||
__m_owner: pointer;
|
|
||||||
__m_kind: cint;
|
|
||||||
__m_lock: _pthread_fastlock;
|
|
||||||
{$ifdef USE_PTHREAD_SIZEOF}
|
|
||||||
);
|
|
||||||
{$endif}
|
|
||||||
end;
|
|
||||||
|
|
||||||
pthread_mutexattr_t = record
|
pthread_mutexattr_t = record
|
||||||
{$ifdef USE_PTHREAD_SIZEOF}
|
{$ifdef USE_PTHREAD_SIZEOF}
|
||||||
|
@ -23,18 +23,12 @@ type
|
|||||||
{ pthread_t is defined as an "unsigned long" }
|
{ pthread_t is defined as an "unsigned long" }
|
||||||
TThreadID = PtrUInt;
|
TThreadID = PtrUInt;
|
||||||
|
|
||||||
{ pthread_mutex_t }
|
|
||||||
PRTLCriticalSection = ^TRTLCriticalSection;
|
PRTLCriticalSection = ^TRTLCriticalSection;
|
||||||
TRTLCriticalSection = record
|
{$macro on}
|
||||||
__m_reserved: longint;
|
{$define MUTEXTYPENAME := TRTLCriticalSection}
|
||||||
__m_count: longint;
|
{$i pmutext.inc}
|
||||||
__m_owner: pointer;
|
{$undef MUTEXTYPENAME}
|
||||||
__m_kind: longint;
|
{$macro off}
|
||||||
__m_lock: record
|
|
||||||
__status: sizeint;
|
|
||||||
__spinlock: longint;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user