|
@@ -19,18 +19,18 @@
|
|
|
|
|
|
**********************************************************************}
|
|
|
|
|
|
- const
|
|
|
+ const
|
|
|
PTHREAD_EXPLICIT_SCHED = 0;
|
|
|
PTHREAD_CREATE_DETACHED = 1;
|
|
|
PTHREAD_SCOPE_PROCESS = 0;
|
|
|
|
|
|
type
|
|
|
pthread_t = culong;
|
|
|
-
|
|
|
+
|
|
|
sched_param = record
|
|
|
__sched_priority: cint;
|
|
|
end;
|
|
|
-
|
|
|
+
|
|
|
pthread_attr_t = record
|
|
|
__detachstate: cint;
|
|
|
__schedpolicy: cint;
|
|
@@ -42,37 +42,29 @@
|
|
|
__stackaddr: pointer;
|
|
|
__stacksize: size_t;
|
|
|
end;
|
|
|
-
|
|
|
+
|
|
|
_pthread_fastlock = record
|
|
|
__status: clong;
|
|
|
__spinlock: cint;
|
|
|
end;
|
|
|
-
|
|
|
- pthread_mutex_t = record
|
|
|
- __m_reserved: cint;
|
|
|
- __m_count: cint;
|
|
|
- __m_owner: pointer;
|
|
|
- __m_kind: cint;
|
|
|
- __m_lock: _pthread_fastlock;
|
|
|
- end;
|
|
|
-
|
|
|
+
|
|
|
pthread_mutexattr_t = record
|
|
|
__mutexkind: cint;
|
|
|
end;
|
|
|
-
|
|
|
+
|
|
|
pthread_cond_t = record
|
|
|
__c_lock: _pthread_fastlock;
|
|
|
__c_waiting: pointer;
|
|
|
__padding: array[0..48-1-sizeof(_pthread_fastlock)-sizeof(pointer)-sizeof(clonglong)] of byte;
|
|
|
__align: clonglong;
|
|
|
end;
|
|
|
-
|
|
|
+
|
|
|
pthread_condattr_t = record
|
|
|
__dummy: cint;
|
|
|
end;
|
|
|
-
|
|
|
+
|
|
|
pthread_key_t = cuint;
|
|
|
-
|
|
|
+
|
|
|
pthread_rwlock_t = record
|
|
|
__rw_readers: cint;
|
|
|
__rw_writer: pointer;
|
|
@@ -81,18 +73,25 @@
|
|
|
__rw_kind: cint;
|
|
|
__rw_pshared: cint;
|
|
|
end;
|
|
|
-
|
|
|
+
|
|
|
pthread_rwlockattr_t = record
|
|
|
__lockkind: cint;
|
|
|
__pshared: cint;
|
|
|
end;
|
|
|
-
|
|
|
+
|
|
|
sem_t = record
|
|
|
- __sem_lock: _pthread_fastlock;
|
|
|
- __sem_value: cint;
|
|
|
- __sem_waiting: pointer;
|
|
|
+ sem_count : uint32_t;
|
|
|
+ sem_type : uint16_t;
|
|
|
+ sem_magic : uint16_t;
|
|
|
+ sem_pad1 : array[0..2] of upad64_t;
|
|
|
+ sem_pad2 : array[0..1] of upad64_t;
|
|
|
end;
|
|
|
-
|
|
|
+
|
|
|
+ psem_t = ^sem_t;
|
|
|
+ TSemaphore = sem_t;
|
|
|
+ PSemaphore = ^TSemaphore;
|
|
|
+
|
|
|
+
|
|
|
ppthread_t = ^pthread_t;
|
|
|
ppthread_key_t = ^pthread_key_t;
|
|
|
ppthread_mutex_t = ^pthread_mutex_t;
|
|
@@ -102,30 +101,7 @@
|
|
|
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
|
|
|
- __detachstate: cint;
|
|
|
- __schedpolicy: cint;
|
|
|
- __schedparam: sched_param;
|
|
|
- __inheritsched: cint;
|
|
|
- __scope: cint;
|
|
|
- __guardsize: size_t;
|
|
|
- __stackaddr_set: cint;
|
|
|
- __stackaddr: pointer;
|
|
|
- __stacksize: size_t;
|
|
|
- end;
|
|
|
-
|
|
|
- _pthread_fastlock = record
|
|
|
- __status: clong;
|
|
|
- __spinlock: cint;
|
|
|
- end;
|
|
|
-
|
|
|
+
|
|
|
pthread_mutex_t = record
|
|
|
__pthread_mutex_flags : record
|
|
|
__pthread_mutex_flag1 : word;
|
|
@@ -147,45 +123,15 @@
|
|
|
end;
|
|
|
__pthread_mutex_data : qword;
|
|
|
end;
|
|
|
-
|
|
|
+
|
|
|
pthread_spinlock_t = pthread_mutex_t;
|
|
|
-
|
|
|
- pthread_mutexattr_t = record
|
|
|
- __mutexkind: cint;
|
|
|
- end;
|
|
|
-
|
|
|
- pthread_cond_t = record
|
|
|
- __c_lock: _pthread_fastlock;
|
|
|
- __c_waiting: pointer;
|
|
|
- __padding: array[0..48-1-sizeof(_pthread_fastlock)-sizeof(pointer)-sizeof(clonglong)] of byte;
|
|
|
- __align: clonglong;
|
|
|
- end;
|
|
|
-
|
|
|
- pthread_condattr_t = record
|
|
|
- __dummy: cint;
|
|
|
- end;
|
|
|
-
|
|
|
- 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;
|
|
|
-
|
|
|
- pthread_rwlockattr_t = record
|
|
|
- __lockkind: cint;
|
|
|
- __pshared: cint;
|
|
|
- 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;
|
|
@@ -194,21 +140,10 @@
|
|
|
__pthread_barrier_lock : pthread_mutex_t;
|
|
|
__pthread_barrier_cond : pthread_cond_t;
|
|
|
end;
|
|
|
-
|
|
|
+
|
|
|
pthread_barrierattr_t = record
|
|
|
__pthread_barrierattrp : pointer;
|
|
|
end;
|
|
|
-
|
|
|
- sem_t = record
|
|
|
- __sem_lock: _pthread_fastlock;
|
|
|
- __sem_value: cint;
|
|
|
- __sem_waiting: pointer;
|
|
|
- end;
|
|
|
-
|
|
|
- sem_t = cint;
|
|
|
- psem_t = ^sem_t;
|
|
|
- TSemaphore = sem_t;
|
|
|
- PSemaphore = ^TSemaphore;
|
|
|
|
|
|
function pthread_getspecific (t : pthread_key_t):pointer; cdecl; external 'c';
|
|
|
function pthread_setspecific (t : pthread_key_t;p:pointer):cint; cdecl; external 'c';
|
|
@@ -245,5 +180,5 @@ function pthread_mutexattr_init(_para1:Ppthread_mutexattr_t):cint;cdecl;external
|
|
|
function pthread_mutexattr_destroy(_para1:Ppthread_mutexattr_t):cint;cdecl;external 'c' name 'pthread_mutexattr_destroy';
|
|
|
function pthread_mutexattr_gettype(_para1:Ppthread_mutexattr_t; _para2:Pcint):cint;cdecl;external 'c' name 'pthread_mutexattr_gettype';
|
|
|
function pthread_mutexattr_settype(_para1:Ppthread_mutexattr_t; _para2:cint):cint;cdecl;external 'c' name 'pthread_mutexattr_settype';
|
|
|
-function pthread_cond_timedwait(__cond:ppthread_cond_t; __mutex:ppthread_mutex_t; __abstime:ptimespec):cint; cdecl;external 'c' name 'pthread_cond_timedwait';
|
|
|
+function pthread_cond_timedwait(__cond:ppthread_cond_t; __mutex:ppthread_mutex_t; __abstime:ptimespec):cint; cdecl;external 'c' name 'pthread_cond_timedwait';
|
|
|
|