Merged signals-merge branch into trunk with the following changes:

* Reorganized the kernel locking related to threads and teams.
* We now discriminate correctly between process and thread signals. Signal
  handlers have been moved to teams. Fixes #5679.
* Implemented real-time signal support, including signal queuing, SA_SIGINFO
  support, sigqueue(), sigwaitinfo(), sigtimedwait(), waitid(), and the addition
  of the real-time signal range. Closes #1935 and #2695.
* Gave SIGBUS a separate signal number. Fixes #6704.
* Implemented <time.h> clock and timer support, and fixed/completed alarm() and
  [set]itimer(). Closes #5682.
* Implemented support for thread cancellation. Closes #5686.
* Moved send_signal() from <signal.h> to <OS.h>. Fixes #7554.
* Lots over smaller more or less related changes.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42116 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2011-06-12 00:00:23 +00:00
parent ccd31b93f1
commit 24df65921b
235 changed files with 14975 additions and 6594 deletions
+64
View File
@@ -52,6 +52,70 @@ typedef char* caddr_t;
typedef __haiku_addr_t addr_t;
typedef __haiku_int32 key_t;
typedef __haiku_std_int32 clockid_t;
typedef struct __timer_t* timer_t;
/* pthread types */
typedef struct _pthread_thread *pthread_t;
typedef struct _pthread_attr *pthread_attr_t;
typedef struct _pthread_mutex pthread_mutex_t;
typedef struct _pthread_mutexattr *pthread_mutexattr_t;
typedef struct _pthread_cond pthread_cond_t;
typedef struct _pthread_condattr *pthread_condattr_t;
typedef int pthread_key_t;
typedef struct _pthread_once pthread_once_t;
typedef struct _pthread_rwlock pthread_rwlock_t;
typedef struct _pthread_rwlockattr *pthread_rwlockattr_t;
typedef struct _pthread_spinlock pthread_spinlock_t;
/*
typedef struct _pthread_barrier *pthread_barrier_t;
typedef struct _pthread_barrierattr *pthread_barrierattr_t;
*/
struct _pthread_mutex {
__haiku_std_uint32 flags;
__haiku_std_int32 lock;
__haiku_std_int32 unused;
__haiku_std_int32 owner;
__haiku_std_int32 owner_count;
};
struct _pthread_cond {
__haiku_std_uint32 flags;
__haiku_std_int32 unused;
pthread_mutex_t* mutex;
__haiku_std_int32 waiter_count;
__haiku_std_int32 lock;
};
struct _pthread_once {
__haiku_std_int32 state;
};
struct _pthread_rwlock {
__haiku_std_uint32 flags;
__haiku_std_int32 owner;
union {
struct {
__haiku_std_int32 sem;
} shared;
struct {
__haiku_std_int32 lock_sem;
__haiku_std_int32 lock_count;
__haiku_std_int32 reader_count;
__haiku_std_int32 writer_count;
void* waiters[2];
} local;
};
};
struct _pthread_spinlock {
__haiku_std_int32 lock;
};
#include <null.h>
#include <size_t.h>
#include <time.h>
+2 -6
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2004-2010 Haiku Inc. All Rights Reserved.
* Copyright 2004-2011, Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _SYS_WAIT_H
@@ -28,16 +28,12 @@
#define WIFCORED(value) ((value) & 0x10000)
#define WIFCONTINUED(value) ((value) & 0x20000)
/* TODO: waitid() is part of the real-time signal extension. Uncomment when
* implemented! */
#if 0
/* ID types for waitid() */
typedef enum {
P_ALL, /* wait for any children, ignore ID */
P_PID, /* wait for the child whose process ID matches */
P_PGID /* wait for any child whose process group ID matches */
} idtype_t;
#endif /* 0 */
#ifdef __cplusplus
@@ -46,7 +42,7 @@ extern "C" {
extern pid_t wait(int *_status);
extern pid_t waitpid(pid_t pid, int *_status, int options);
/* extern int waitid(idtype_t idType, id_t id, siginfo_t *info, int options); */
extern int waitid(idtype_t idType, id_t id, siginfo_t *info, int options);
#ifdef __cplusplus
}