File: pmutext.inc

package info (click to toggle)
fpc 3.0.0%2Bdfsg-11
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 273,372 kB
  • sloc: pascal: 2,840,574; xml: 152,225; ansic: 9,635; asm: 8,297; java: 5,346; sh: 3,991; yacc: 3,745; php: 3,281; makefile: 2,635; lex: 2,538; sql: 267; cpp: 145; perl: 134; sed: 132; csh: 34; tcl: 7
file content (58 lines) | stat: -rw-r--r-- 1,720 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
{
    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 }

{$if defined(CPUMIPS) or defined(cpuaarch64)}
{$define USE_PTHREAD_SIZEOF}

{$if defined(cpuaarch64)}
  {$define __SIZEOF_PTHREAD_MUTEX_T := 48}
{$elseif defined(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}