phobos 0.155

This commit is contained in:
Brad Roberts 2007-09-10 05:19:06 +00:00
parent 91c29ea1dd
commit f3114b30a0
73 changed files with 854 additions and 21315 deletions

View file

@ -380,3 +380,115 @@ extern (C)
int getpwnam_r(char*, passwd*, void*, size_t, passwd**);
}
extern (C)
{
/* pthread declarations taken from pthread headers and
http://svn.dsource.org/projects/bindings/trunk/pthreads.d
*/
/* from bits/types.h
*/
typedef int __time_t;
/* from time.h
*/
struct timespec
{
__time_t tv_sec; /* seconds */
int tv_nsec; /* nanosecs. */
}
/* from bits/pthreadtypes.h
*/
struct _pthread_descr_struct
{
/* Not defined in the headers ???
Just needed here to typedef
the _pthread_descr pointer
*/
}
typedef _pthread_descr_struct* _pthread_descr;
struct _pthread_fastlock
{
int __status;
int __spinlock;
}
typedef long __pthread_cond_align_t;
struct pthread_cond_t
{
_pthread_fastlock __c_lock;
_pthread_descr __c_waiting;
char[48
- _pthread_fastlock.sizeof
- _pthread_descr.sizeof
- __pthread_cond_align_t.sizeof
] __padding;
__pthread_cond_align_t __align;
}
struct pthread_condattr_t
{
int __dummy;
}
struct pthread_mutex_t
{
int __m_reserved;
int __m_count;
_pthread_descr __m_owner;
int __m_kind;
_pthread_fastlock __m_lock;
}
struct pthread_mutexattr_t
{
int __mutexkind;
}
/* from pthread.h
*/
int pthread_mutex_init(pthread_mutex_t*, pthread_mutexattr_t*);
int pthread_mutex_destroy(pthread_mutex_t*);
int pthread_mutex_trylock(pthread_mutex_t*);
int pthread_mutex_lock(pthread_mutex_t*);
int pthread_mutex_unlock(pthread_mutex_t*);
int pthread_mutexattr_init(pthread_mutexattr_t*);
int pthread_mutexattr_destroy(pthread_mutexattr_t*);
int pthread_cond_init(pthread_cond_t*, pthread_condattr_t*);
int pthread_cond_destroy(pthread_cond_t*);
int pthread_cond_signal(pthread_cond_t*);
int pthread_cond_wait(pthread_cond_t*, pthread_mutex_t*);
int pthread_cond_timedwait(pthread_cond_t*, pthread_mutex_t*, timespec*);
}
extern (C)
{
/* from semaphore.h
*/
struct sem_t
{
_pthread_fastlock __sem_lock;
int __sem_value;
void* __sem_waiting;
}
int sem_init(sem_t*, int, uint);
int sem_wait(sem_t*);
int sem_trywait(sem_t*);
int sem_post(sem_t*);
int sem_getvalue(sem_t*, int*);
int sem_destroy(sem_t*);
}