소스 검색

* fix size of pthread_rwlock_t. Mantis #21552 Fields are now opaque.

git-svn-id: trunk@21243 -
marco 13 년 전
부모
커밋
a0becaa727
1개의 변경된 파일9개의 추가작업 그리고 8개의 파일을 삭제
  1. 9 8
      rtl/linux/ptypes.inc

+ 9 - 8
rtl/linux/ptypes.inc

@@ -232,15 +232,16 @@ Type
 
   pthread_key_t = cuint;
 
-  pthread_rwlock_t = record
-    __rw_readers: cint;
-    __rw_writer: pointer;
-    __rw_read_waiting: pointer;
-    __rw_write_waiting: pointer;
-    __rw_kind: cint;
-    __rw_pshared: cint;
-  end;
+const
+  pthreadrwlocksize =  {$ifdef CPU64} 56{$else}32{$endif};
+
+type 
 
+  pthread_rwlock_t = record // should be 56 for 64-bit, 32 bytes for 32-bit mantis #21552
+			case boolean of
+			 false : (_data : array[0..pthreadrwlocksize-1] of char);
+		         true  : (align : clong);
+  end;
   pthread_rwlockattr_t = record
     __lockkind: cint;
     __pshared: cint;