|
@@ -9,109 +9,114 @@
|
|
|
|
|
|
type
|
|
|
{ from sem.h }
|
|
|
- sem_t = cint;
|
|
|
- psem_t = ^sem_t;
|
|
|
- TSemaphore = sem_t;
|
|
|
- PSemaphore = ^TSemaphore;
|
|
|
+ sem_t = cint;
|
|
|
+ psem_t = ^sem_t;
|
|
|
+ TSemaphore = sem_t;
|
|
|
+ PSemaphore = ^TSemaphore;
|
|
|
|
|
|
const
|
|
|
External_library='c'; {Setup as you need}
|
|
|
|
|
|
Type
|
|
|
- ppthread_t = ^pthread_t;
|
|
|
- ppthread_key_t = ^pthread_key_t;
|
|
|
- ppthread_mutex_t = ^pthread_mutex_t;
|
|
|
- ppthread_attr_t = ^pthread_attr_t;
|
|
|
- __destr_func_t = procedure (p :pointer);cdecl;
|
|
|
- __startroutine_t = function (p :pointer):pointer;cdecl;
|
|
|
- ppthread_mutexattr_t = ^pthread_mutexattr_t;
|
|
|
- ppthread_cond_t = ^pthread_cond_t;
|
|
|
- ppthread_condattr_t = ^pthread_condattr_t;
|
|
|
-
|
|
|
- pthread_t = culong;
|
|
|
-
|
|
|
- sched_param = record
|
|
|
- __sched_priority: cint;
|
|
|
- end;
|
|
|
-
|
|
|
- pthread_attr_t = record
|
|
|
- __pthread_attrp : pointer;
|
|
|
- end;
|
|
|
-
|
|
|
-
|
|
|
- pthread_mutex_t = record
|
|
|
- __pthread_mutex_flags : record
|
|
|
- __pthread_mutex_flag1 : word;
|
|
|
- __pthread_mutex_flag2 : byte;
|
|
|
- __pthread_mutex_ceiling : byte;
|
|
|
- __pthread_mutex_type : word;
|
|
|
- __pthread_mutex_magic : word;
|
|
|
- end;
|
|
|
- __pthread_mutex_lock : record
|
|
|
- case longint of
|
|
|
- 0 : ( __pthread_mutex_lock64 : record
|
|
|
- __pthread_mutex_pad : array[0..7] of byte;
|
|
|
- end );
|
|
|
- 1 : ( __pthread_mutex_lock32 : record
|
|
|
- __pthread_ownerpid : dword;
|
|
|
- __pthread_lockword : dword;
|
|
|
- end );
|
|
|
- 2 : ( __pthread_mutex_owner64 : qword );
|
|
|
- end;
|
|
|
- __pthread_mutex_data : qword;
|
|
|
- end;
|
|
|
-
|
|
|
- pthread_spinlock_t = pthread_mutex_t;
|
|
|
-
|
|
|
- pthread_mutexattr_t = record
|
|
|
- __pthread_mutexattrp : pointer;
|
|
|
- end;
|
|
|
-
|
|
|
- pthread_cond_t = record
|
|
|
- __pthread_cond_flags : record
|
|
|
- __pthread_cond_flag : array[0..3] of byte;
|
|
|
- __pthread_cond_type : uint16_t;
|
|
|
- __pthread_cond_magic : uint16_t;
|
|
|
- end;
|
|
|
- __pthread_cond_data : upad64_t;
|
|
|
- end;
|
|
|
-
|
|
|
- pthread_condattr_t = record
|
|
|
- __pthread_condattrp : pointer;
|
|
|
- end;
|
|
|
-
|
|
|
- pthread_key_t = cuint;
|
|
|
-
|
|
|
- pthread_rwlock_t = record
|
|
|
- __pthread_rwlock_readers : int32_t;
|
|
|
- __pthread_rwlock_type : uint16_t;
|
|
|
- __pthread_rwlock_magic : uint16_t;
|
|
|
- __pthread_rwlock_mutex : pthread_mutex_t;
|
|
|
- __pthread_rwlock_readercv : pthread_cond_t;
|
|
|
- __pthread_rwlock_writercv : pthread_cond_t;
|
|
|
- end;
|
|
|
-
|
|
|
- pthread_rwlockattr_t = record
|
|
|
- __pthread_rwlockattrp : pointer;
|
|
|
- end;
|
|
|
-
|
|
|
- _once = record
|
|
|
- __pthread_once_pad : array[0..3] of upad64_t;
|
|
|
- end;
|
|
|
- pthread_once_t = _once;
|
|
|
-
|
|
|
- pthread_barrier_t = record
|
|
|
- __pthread_barrier_count : uint32_t;
|
|
|
- __pthread_barrier_current : uint32_t;
|
|
|
- __pthread_barrier_cycle : upad64_t;
|
|
|
- __pthread_barrier_reserved : upad64_t;
|
|
|
- __pthread_barrier_lock : pthread_mutex_t;
|
|
|
- __pthread_barrier_cond : pthread_cond_t;
|
|
|
- end;
|
|
|
-
|
|
|
- pthread_barrierattr_t = record
|
|
|
- __pthread_barrierattrp : pointer;
|
|
|
- end;
|
|
|
+ ppthread_t = ^pthread_t;
|
|
|
+ ppthread_key_t = ^pthread_key_t;
|
|
|
+ ppthread_mutex_t = ^pthread_mutex_t;
|
|
|
+ ppthread_attr_t = ^pthread_attr_t;
|
|
|
+ __destr_func_t = procedure (p :pointer);cdecl;
|
|
|
+ __startroutine_t = function (p :pointer):pointer;cdecl;
|
|
|
+ ppthread_mutexattr_t = ^pthread_mutexattr_t;
|
|
|
+ ppthread_cond_t = ^pthread_cond_t;
|
|
|
+ ppthread_condattr_t = ^pthread_condattr_t;
|
|
|
+
|
|
|
+ {already in unixtype
|
|
|
+ pthread_t = culong
|
|
|
+ }
|
|
|
+
|
|
|
+ sched_param = record
|
|
|
+ __sched_priority: cint;
|
|
|
+ end;
|
|
|
+
|
|
|
+ pthread_attr_t = record
|
|
|
+ __pthread_attrp : pointer;
|
|
|
+ end;
|
|
|
+
|
|
|
+{ already in unixtype
|
|
|
+ pthread_mutex_t = record
|
|
|
+ __pthread_mutex_flags : record
|
|
|
+ __pthread_mutex_flag1 : word;
|
|
|
+ __pthread_mutex_flag2 : byte;
|
|
|
+ __pthread_mutex_ceiling : byte;
|
|
|
+ __pthread_mutex_type : word;
|
|
|
+ __pthread_mutex_magic : word;
|
|
|
+ end;
|
|
|
+}
|
|
|
+ __pthread_mutex_lock : record
|
|
|
+ case longint of
|
|
|
+ 0 : ( __pthread_mutex_lock64 : record
|
|
|
+ __pthread_mutex_pad : array[0..7] of byte;
|
|
|
+ end );
|
|
|
+ 1 : ( __pthread_mutex_lock32 : record
|
|
|
+ __pthread_ownerpid : dword;
|
|
|
+ __pthread_lockword : dword;
|
|
|
+ end );
|
|
|
+ 2 : ( __pthread_mutex_owner64 : qword );
|
|
|
+ end;
|
|
|
+ __pthread_mutex_data : qword;
|
|
|
+ end;
|
|
|
+
|
|
|
+ pthread_spinlock_t = pthread_mutex_t;
|
|
|
+
|
|
|
+ pthread_mutexattr_t = record
|
|
|
+ __pthread_mutexattrp : pointer;
|
|
|
+ end;
|
|
|
+
|
|
|
+{ already in unix type
|
|
|
+ pthread_cond_t = record
|
|
|
+ __pthread_cond_flags : record
|
|
|
+ __pthread_cond_flag : array[0..3] of byte;
|
|
|
+ __pthread_cond_type : uint16_t;
|
|
|
+ __pthread_cond_magic : uint16_t;
|
|
|
+ end;
|
|
|
+ __pthread_cond_data : upad64_t;
|
|
|
+ end;
|
|
|
+}
|
|
|
+
|
|
|
+ pthread_condattr_t = record
|
|
|
+ __pthread_condattrp : pointer;
|
|
|
+ end;
|
|
|
+
|
|
|
+ pthread_key_t = cuint;
|
|
|
+
|
|
|
+ pthread_rwlock_t = record
|
|
|
+ __pthread_rwlock_readers : int32_t;
|
|
|
+ __pthread_rwlock_type : uint16_t;
|
|
|
+ __pthread_rwlock_magic : uint16_t;
|
|
|
+ __pthread_rwlock_mutex : pthread_mutex_t;
|
|
|
+ __pthread_rwlock_readercv : pthread_cond_t;
|
|
|
+ __pthread_rwlock_writercv : pthread_cond_t;
|
|
|
+ end;
|
|
|
+
|
|
|
+ pthread_rwlockattr_t = record
|
|
|
+ __pthread_rwlockattrp : pointer;
|
|
|
+ end;
|
|
|
+
|
|
|
+ _once = record
|
|
|
+ __pthread_once_pad : array[0..3] of upad64_t;
|
|
|
+ end;
|
|
|
+ pthread_once_t = _once;
|
|
|
+
|
|
|
+ pthread_barrier_t = record
|
|
|
+ __pthread_barrier_count : uint32_t;
|
|
|
+ __pthread_barrier_current : uint32_t;
|
|
|
+ __pthread_barrier_cycle : upad64_t;
|
|
|
+ __pthread_barrier_reserved : upad64_t;
|
|
|
+ __pthread_barrier_lock : pthread_mutex_t;
|
|
|
+ __pthread_barrier_cond : pthread_cond_t;
|
|
|
+ end;
|
|
|
+
|
|
|
+ pthread_barrierattr_t = record
|
|
|
+ __pthread_barrierattrp : pointer;
|
|
|
+ end;
|
|
|
|
|
|
P_cleanup_t = ^_cleanup_t;
|
|
|
Pclockid_t = ^clockid_t;
|
|
@@ -330,23 +335,23 @@ function pthread_barrier_init(_RESTRICT_KYWD1:Ppthread_barrier_t; _RESTRICT_KYWD
|
|
|
function pthread_barrier_destroy(_para1:Ppthread_barrier_t):longint;cdecl;external External_library name 'pthread_barrier_destroy';
|
|
|
function pthread_barrier_wait(_para1:Ppthread_barrier_t):longint;cdecl;external External_library name 'pthread_barrier_wait';
|
|
|
|
|
|
-function sem_init(__sem:Psem_t; __pshared:cint;__value:cuint):cint;cdecl; external 'c' name 'sem_init';
|
|
|
-function sem_destroy(__sem:Psem_t):cint;cdecl;external 'c' name 'sem_destroy';
|
|
|
-function sem_close(__sem:Psem_t):cint;cdecl;external 'c' name 'sem_close';
|
|
|
-function sem_unlink(__name:Pchar):cint;cdecl;external 'c' name 'sem_unlink';
|
|
|
-function sem_wait(__sem:Psem_t):cint;cdecl;external 'c' name 'sem_wait';
|
|
|
-function sem_trywait(__sem:Psem_t):cint;cdecl;external 'c' name 'sem_trywait';
|
|
|
-function sem_post(__sem:Psem_t):cint;cdecl;external 'c' name 'sem_post';
|
|
|
-function sem_getvalue(__sem:Psem_t; __sval:Pcint):cint;cdecl;external 'c' name 'sem_getvalue';
|
|
|
+function sem_init(__sem:Psem_t; __pshared:cint;__value:cuint):cint;cdecl; external 'c' name 'sem_init';
|
|
|
+function sem_destroy(__sem:Psem_t):cint;cdecl;external 'c' name 'sem_destroy';
|
|
|
+function sem_close(__sem:Psem_t):cint;cdecl;external 'c' name 'sem_close';
|
|
|
+function sem_unlink(__name:Pchar):cint;cdecl;external 'c' name 'sem_unlink';
|
|
|
+function sem_wait(__sem:Psem_t):cint;cdecl;external 'c' name 'sem_wait';
|
|
|
+function sem_trywait(__sem:Psem_t):cint;cdecl;external 'c' name 'sem_trywait';
|
|
|
+function sem_post(__sem:Psem_t):cint;cdecl;external 'c' name 'sem_post';
|
|
|
+function sem_getvalue(__sem:Psem_t; __sval:Pcint):cint;cdecl;external 'c' name 'sem_getvalue';
|
|
|
|
|
|
type
|
|
|
{ redefinitions }
|
|
|
- TThreadAttr = pthread_attr_t;
|
|
|
- PThreadAttr = ^TThreadAttr;
|
|
|
-
|
|
|
- TMutexAttribute = pthread_mutexattr_t;
|
|
|
- PMutexAttribute = ^TMutexAttribute;
|
|
|
+ TThreadAttr = pthread_attr_t;
|
|
|
+ PThreadAttr = ^TThreadAttr;
|
|
|
+
|
|
|
+ TMutexAttribute = pthread_mutexattr_t;
|
|
|
+ PMutexAttribute = ^TMutexAttribute;
|
|
|
|
|
|
TPthreadMutex = pthread_mutex_t;
|
|
|
PPthreadMutex = ^TPthreadMutex;
|
|
|
-
|
|
|
+
|