summaryrefslogtreecommitdiff
path: root/PACE
diff options
context:
space:
mode:
authorluther <luther@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2000-08-15 02:48:39 +0000
committerluther <luther@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2000-08-15 02:48:39 +0000
commit87c01d3efc2e2ecd71958d196d100f83c9b8994b (patch)
treeb6fbf22573bd994fe0c5d38e1cadf2d1fa83d398 /PACE
parent194a0c66602a43c9017bae15cbf69a8f23890e50 (diff)
downloadATCD-87c01d3efc2e2ecd71958d196d100f83c9b8994b.tar.gz
Mon Aug 14 21:41:24 2000 Luther J Baker <luther@cs.wustl.edu>
Diffstat (limited to 'PACE')
-rw-r--r--PACE/ChangeLog26
-rw-r--r--PACE/pace/pthread.h4
-rw-r--r--PACE/pace/win32/pthread.h5
-rw-r--r--PACE/pace/win32/pthread.inl4
-rw-r--r--PACE/pace/win32/pthreadtypes.h134
-rw-r--r--PACE/pace/win32/sched.h13
-rw-r--r--PACE/pace/win32/sched.inl2
-rw-r--r--PACE/pace/win32/schedtypes.h67
-rw-r--r--PACE/pace/win32/time.h6
-rw-r--r--PACE/pace/win32/types.h70
10 files changed, 250 insertions, 81 deletions
diff --git a/PACE/ChangeLog b/PACE/ChangeLog
index d0d0d82f72c..f8fdbba1ff2 100644
--- a/PACE/ChangeLog
+++ b/PACE/ChangeLog
@@ -1,3 +1,27 @@
+Mon Aug 14 21:41:24 2000 Luther J Baker <luther@cs.wustl.edu>
+
+ * pace/win32/pthreadtypes.h:
+ * pace/win32/schedtypes.h:
+
+ Added to repository to break up the complexity
+ of the code and avoid circular dependencies.
+
+ * pace/win32/types.h:
+
+ Updated declarations to remove circular dependencies.
+
+ * pace/win32/sched.h:
+
+ Updated to use schedtypes.h.
+
+ * pace/win32/pthread.h:
+
+ Updated to use pthreadtypes.h.
+
+ * pace/pthread.h:
+
+ Updated signatures to use pace prefixed types.
+
Thu Aug 10 04:18:14 2000 John Heitmann <jwh1@cs.wustl.edu>
* tests/Stdio_Test.c:
@@ -7,7 +31,7 @@ Thu Aug 10 04:18:14 2000 John Heitmann <jwh1@cs.wustl.edu>
* pace/mqueue.h
* pace/semaphore.h
* pace/stdio.h
- Removed glodal scope modifier, since it should be
+ Removed global scope modifier, since it should be
supplied by the client.
Wed Aug 09 19:30:39 2000 Luther J Baker <luther@cs.wustl.edu>
diff --git a/PACE/pace/pthread.h b/PACE/pace/pthread.h
index 50fded9d2ad..148a99ef5e4 100644
--- a/PACE/pace/pthread.h
+++ b/PACE/pace/pthread.h
@@ -274,7 +274,7 @@ extern "C" {
IEEE Std 1003.1, 1996 Edition), Section 11.4.4.
*/
#if (PACE_HAS_POSIX_NONUOF_FUNCS)
- PACE_INLINE int pace_pthread_cond_timedwait (pthread_cond_t * cond,
+ PACE_INLINE int pace_pthread_cond_timedwait (pace_pthread_cond_t * cond,
pace_pthread_mutex_t * mutex,
const pace_timespec * abstime);
#endif /* PACE_HAS_POSIX_NONUOF_FUNCS */
@@ -480,7 +480,7 @@ extern "C" {
IEEE Std 1003.1, 1996 Edition), Section 11.3.3.
*/
#if (PACE_HAS_POSIX_NONUOF_FUNCS)
- PACE_INLINE int pace_pthread_mutex_trylock (pthread_mutex_t * mutex);
+ PACE_INLINE int pace_pthread_mutex_trylock (pace_pthread_mutex_t * mutex);
#endif /* PACE_HAS_POSIX_NONUOF_FUNCS */
/**
diff --git a/PACE/pace/win32/pthread.h b/PACE/pace/win32/pthread.h
index 91f84b50948..b7f04c1c68b 100644
--- a/PACE/pace/win32/pthread.h
+++ b/PACE/pace/win32/pthread.h
@@ -43,11 +43,6 @@ extern "C" {
#define PACE_PTHREAD_SCOPE_PROCESS PTHREAD_SCOPE_PROCESS
#define PACE_PTHREAD_SCOPE_SYSTEM PTHREAD_SCOPE_SYSTEM
-#ifndef PACE_SCHED_PARAM
-#define PACE_SCHED_PARAM
- typedef struct sched_param pace_sched_param;
-#endif /* PACE_SCHED_PARAM */
-
#if defined (PACE_HAS_CPLUSPLUS)
# ifndef PACE_ATFORK_PF
diff --git a/PACE/pace/win32/pthread.inl b/PACE/pace/win32/pthread.inl
index 725b646e989..3f81a7f653d 100644
--- a/PACE/pace/win32/pthread.inl
+++ b/PACE/pace/win32/pthread.inl
@@ -272,7 +272,7 @@ pace_pthread_cond_signal (pace_pthread_cond_t * cond)
#if (PACE_HAS_POSIX_NONUOF_FUNCS)
PACE_INLINE
int
-pace_pthread_cond_timedwait (pthread_cond_t * cond,
+pace_pthread_cond_timedwait (pace_pthread_cond_t * cond,
pace_pthread_mutex_t * mutex,
const struct timespec * abstime)
{
@@ -517,7 +517,7 @@ pace_pthread_mutex_setprioceiling (pace_pthread_mutex_t * mutex,
#if (PACE_HAS_POSIX_NONUOF_FUNCS)
PACE_INLINE
int
-pace_pthread_mutex_trylock (pthread_mutex_t * mutex)
+pace_pthread_mutex_trylock (pace_pthread_mutex_t * mutex)
{
PACE_UNUSED_ARG (mutex);
PACE_ERRNO_NO_SUPPORT_RETURN (-1);
diff --git a/PACE/pace/win32/pthreadtypes.h b/PACE/pace/win32/pthreadtypes.h
new file mode 100644
index 00000000000..c092e6bfda7
--- /dev/null
+++ b/PACE/pace/win32/pthreadtypes.h
@@ -0,0 +1,134 @@
+/* $Id$
+
+ * ============================================================================
+ *
+ * = LIBRARY
+ * pace
+ *
+ * = FILENAME
+ * pace/win32/pthreadtypes.h
+ *
+ * = AUTHOR
+ * Luther Baker
+ *
+ * ============================================================================ */
+
+/* Keep pthread types defined here as they just clutter up sys/types.h
+
+ * Do NOT include this file directly!! Please include "sys/types.h". */
+
+#ifndef PACE_SYS_PTHREADTYPES_H_WIN32
+#define PACE_SYS_PTHREADTYPES_H_WIN32
+
+#include "pace/win32/schedtypes.h"
+
+#if defined (PACE_HAS_CPLUSPLUS)
+extern "C" {
+#endif /* PACE_HAS_CPLUSPLUS */
+
+#ifndef PACE_PTHREAD_ATTR_T
+#define PACE_PTHREAD_ATTR_T 1
+ typedef struct pthread_attr_t
+ {
+ int detach_;
+ int policy_;
+ pace_sched_param priority_;
+ int inherit_sched_;
+ int scope;
+ pace_size_t guard_size_;
+ int stackaddr_set_ ;
+ void * stack_addr_;
+ pace_size_t stack_size_;
+ } pace_pthread_attr_t;
+#endif /* PACE_PTHREAD_ATTR_T */
+
+#ifndef PACE_PTHREAD_COND_T
+#define PACE_PTHREAD_COND_T 1
+
+
+
+
+
+ typedef struct pthread_cond_t
+ {
+#if 0
+ /* Concurrent access protection. */
+ struct _pthread_fastlock __c_lock;
+
+ /* Pool of threads waiting. */
+ _pthread_descr __c_waiting;
+#endif
+ int a;
+
+ } pace_pthread_cond_t;
+
+
+
+
+
+#endif /* PACE_PTHREAD_COND_T */
+
+#ifndef PACE_PTHREAD_CONDATTR_T
+#define PACE_PTHREAD_CONDATTR_T 1
+ typedef struct pthread_condattr_t
+ {
+ int not_used_;
+ } pace_pthread_condattr_t;
+#endif /* PACE_PTHREAD_CONDATTR_T */
+
+#ifndef PACE_PTHREAD_KEY_T
+#define PACE_PTHREAD_KEY_T 1
+ typedef unsigned int pthread_key_t;
+ typedef pthread_key_t pace_pthread_key_t;
+#endif /* PACE_PTHREAD_KEY_T */
+
+#ifndef PACE_PTHREAD_MUTEX_T
+#define PACE_PTHREAD_MUTEX_T 1
+ typedef struct pthread_mutex_t
+ {
+ /* Depth of recursive locking */
+ int recursive_count_;
+
+#if 0
+ /* Owner thread (if recursive or errcheck) */
+ _pthread_descr __m_owner;
+#endif
+
+ /* Mutex kind: fast, recursive or errcheck */
+ int mutex_kind_;
+
+#if 0
+ /* Underlying fast lock */
+ struct _pthread_fastlock __m_lock;
+#endif
+
+ } pace_pthread_mutex_t;
+#endif /* PACE_PTHREAD_MUTEX_T */
+
+#ifndef PACE_PTHREAD_MUTEXATTR_T
+#define PACE_PTHREAD_MUTEXATTR_T
+ typedef struct pthread_mutexattr_t
+ {
+ int mutex_kind_;
+ } pace_pthread_mutexattr_t;
+#endif /* PACE_PTHREAD_MUTEXATTR_T */
+
+#ifndef PACE_PTHREAD_ONCE
+#define PACE_PTHREAD_ONCE
+
+ typedef int pthread_once_t;
+ typedef pthread_once_t pace_pthread_once_t;
+
+#endif /* PACE_PTHREAD_ONCE */
+
+#ifndef PACE_PTHREAD_T
+#define PACE_PTHREAD_T
+ typedef DWORD pace_pthread_t;
+ typedef HANDLE pace_hpthread_t;
+#endif /* PACE_PTHREAD_T */
+
+#if defined (PACE_HAS_CPLUSPLUS)
+}
+#endif /* PACE_HAS_CPLUSPLUS */
+
+#endif /* PACE_SYS_PTHREADTYPES_H_WIN32 */
diff --git a/PACE/pace/win32/sched.h b/PACE/pace/win32/sched.h
index 795fb73e39e..6c04ae6b995 100644
--- a/PACE/pace/win32/sched.h
+++ b/PACE/pace/win32/sched.h
@@ -16,20 +16,17 @@
#ifndef PACE_SCHED_H_WIN32
#define PACE_SCHED_H_WIN32
+ /* These definitions are used in other files.
+ * Separate the declarations from the definitions to avoid circular
+ * inclusion. ie: some other funcs just need the typedefs and structs. */
+
+#include "pace/win32/schedtypes.h"
#include "pace/time.h"
#if defined (PACE_HAS_CPLUSPLUS)
extern "C" {
#endif /* PACE_HAS_CPLUSPLUS */
-#define PACE_SCHED_FIFO SCHED_FIFO
-#define PACE_SCHED_OTHER SCHED_RR
-
-#ifndef PACE_SCHED_PARAM
-#define PACE_SCHED_PARAM
- typedef struct sched_param { int a_; } pace_sched_param;
-#endif
-
#if defined (PACE_HAS_CPLUSPLUS)
}
#endif /* PACE_HAS_CPLUSPLUS */
diff --git a/PACE/pace/win32/sched.inl b/PACE/pace/win32/sched.inl
index 06577337db6..61cf2e0858e 100644
--- a/PACE/pace/win32/sched.inl
+++ b/PACE/pace/win32/sched.inl
@@ -13,6 +13,8 @@
*
* ============================================================================= */
+#include "pace/time.h"
+
#if (PACE_HAS_POSIX_NONUOF_FUNCS)
PACE_INLINE
int
diff --git a/PACE/pace/win32/schedtypes.h b/PACE/pace/win32/schedtypes.h
new file mode 100644
index 00000000000..05aa53778b9
--- /dev/null
+++ b/PACE/pace/win32/schedtypes.h
@@ -0,0 +1,67 @@
+/* $Id$
+
+ * ============================================================================
+ *
+ * = LIBRARY
+ * pace
+ *
+ * = FILENAME
+ * pace/win32/schedtypes.h
+ *
+ * = AUTHOR
+ * Luther Baker
+ *
+ * ============================================================================ */
+
+/* Keep sched types defined here as they need to be in more than one
+ * file and otherwise cause circular dependencies.
+
+ * Do NOT include this file directly!! Please include "pace/sched.h". */
+
+#ifndef PACE_SYS_SCHEDTYPES_H_WIN32
+#define PACE_SYS_SCHEDTYPES_H_WIN32
+
+#if defined (PACE_HAS_CPLUSPLUS)
+extern "C" {
+#endif /* PACE_HAS_CPLUSPLUS */
+
+ /* These are defined via POSIX, but win32 is not POSIX compliant!
+ * So please forgive me for these (non pace prefix) sins! */
+
+#ifndef SCHED_OTHER
+#define SCHED_OTHER 0
+#endif /* SCHED_RR */
+
+#ifndef SCHED_FIFO
+#define SCHED_FIFO 1
+#endif /* SCHED_FIFO */
+
+#ifndef SCHED_RR
+#define SCHED_RR 2
+#endif /* SCHED_RR */
+
+#ifndef PACE_SCHED_OTHER
+#define PACE_SCHED_OTHER SCHED_OTHER
+#endif /* PACE_SCHED_OTHER */
+
+#ifndef PACE_SCHED_FIFO
+#define PACE_SCHED_FIFO SCHED_FIFO
+#endif /* PACE_SCHED_FIFO */
+
+#ifndef PACE_SCHED_RR
+#define PACE_SCHED_RR SCHED_RR
+#endif /* PACE_SCHED_RR */
+
+#ifndef PACE_SCHED_PARAM
+#define PACE_SCHED_PARAM 1
+ typedef struct sched_param
+ {
+ int the_priority_;
+ } pace_sched_param;
+#endif
+
+#if defined (PACE_HAS_CPLUSPLUS)
+}
+#endif /* PACE_HAS_CPLUSPLUS */
+
+#endif /* PACE_SYS_SCHEDTYPES_H_WIN32 */
diff --git a/PACE/pace/win32/time.h b/PACE/pace/win32/time.h
index 5a5a12ad1d6..8358ec9124b 100644
--- a/PACE/pace/win32/time.h
+++ b/PACE/pace/win32/time.h
@@ -17,6 +17,7 @@
#define PACE_TIME_H_WIN32
#include <time.h>
+#include "pace/sys/types.h"
#if defined (PACE_HAS_CPLUSPLUS)
extern "C" {
@@ -39,11 +40,6 @@ extern "C" {
typedef clock_t pace_clock_t;
#endif /* PACE_CLOCK_T */
-#ifndef PACE_SIZE_T
-#define PACE_SIZE_T
- typedef size_t pace_size_t;
-#endif /* PACE_SIZE_T */
-
#ifndef PACE_TIMER_T
#define PACE_TIMER_T
typedef long timer_t;
diff --git a/PACE/pace/win32/types.h b/PACE/pace/win32/types.h
index 520a5db655e..b7ebdeda9cd 100644
--- a/PACE/pace/win32/types.h
+++ b/PACE/pace/win32/types.h
@@ -25,105 +25,57 @@ extern "C" {
#endif /* PACE_HAS_CPLUSPLUS */
#ifndef PACE_TCHAR
-#define PACE_TCHAR
+#define PACE_TCHAR 1
typedef char pace_tchar;
#endif /* PACE_TCHAR */
#ifndef PACE_HANDLE
- typedef HANDLE PACE_HANDLE;
+#define PACE_HANDLE HANDLE
#endif /* PACE_HANDLE */
#ifndef PACE_INVALID_HANDLE
-#define PACE_INVALID_HANDLE (HANDLE)0
+#define PACE_INVALID_HANDLE (HANDLE)-1
#endif /* PACE_INVALID_HANDLE */
#ifndef PACE_DEV_T
-#define PACE_DEV_T
+#define PACE_DEV_T 1
typedef dev_t pace_dev_t;
#endif /* PACE_DEV_T */
#ifndef PACE_GID_T
-#define PACE_GID_T
+#define PACE_GID_T 1
typedef int gid_t;
typedef gid_t pace_gid_t;
#endif /* PACE_GID_T */
#ifndef PACE_INO_T
-#define PACE_INO_T
+#define PACE_INO_T 1
typedef ino_t pace_ino_t;
#endif /* PACE_INO_T */
#ifndef PACE_MODE_T
-#define PACE_MODE_T
+#define PACE_MODE_T 1
typedef int mode_t;
typedef mode_t pace_mode_t;
#endif /* PACE_MODE_T */
#ifndef PACE_NLINK_T
-#define PACE_NLINK_T
+#define PACE_NLINK_T 1
typedef DWORD nlink_t;
typedef nlink_t pace_nlink_t;
#endif /* PACE_NLINK_T */
#ifndef PACE_OFF_T
-#define PACE_OFF_T
+#define PACE_OFF_T 1
typedef off_t pace_off_t;
#endif /* PACE_OFF_T */
#ifndef PACE_PID_T
-#define PACE_PID_T
+#define PACE_PID_T 1
typedef long pid_t;
typedef pid_t pace_pid_t;
#endif /* PACE_PID_T */
-#ifndef PACE_PTHREAD_ATTR_T
-#define PACE_PTHREAD_ATTR_T
- typedef int pthread_attr_t; /* temporary */
- typedef pthread_attr_t pace_pthread_attr_t;
-#endif /* PACE_PTHREAD_ATTR_T */
-
-#ifndef PACE_PTHREAD_CONDATTR_T
-#define PACE_PTHREAD_CONDATTR_T
- typedef int pthread_condattr_t; /* temporary */
- typedef pthread_condattr_t pace_pthread_condattr_t;
-#endif /* PACE_PTHREAD_CONDATTR_T */
-
-#ifndef PACE_PTHREAD_COND_T
-#define PACE_PTHREAD_COND_T
- typedef int pthread_cond_t; /* temporary */
- typedef pthread_cond_t pace_pthread_cond_t;
-#endif /* PACE_PTHREAD_COND_T */
-
-#ifndef PACE_PTHREAD_KEY_T
-#define PACE_PTHREAD_KEY_T
- typedef int pthread_key_t; /* temporary */
- typedef pthread_key_t pace_pthread_key_t;
-#endif /* PACE_PTHREAD_KEY_T */
-
-#ifndef PACE_PTHREAD_MUTEXATTR_T
-#define PACE_PTHREAD_MUTEXATTR_T
- typedef int pthread_mutexattr_t; /* temporary */
- typedef pthread_mutexattr_t pace_pthread_mutexattr_t;
-#endif /* PACE_PTHREAD_MUTEXATTR_T */
-
-#ifndef PACE_PTHREAD_MUTEX_T
-#define PACE_PTHREAD_MUTEX_T
- typedef int pthread_mutex_t; /* temporary */
- typedef pthread_mutex_t pace_pthread_mutex_t;
-#endif /* PACE_PTHREAD_MUTEX_T */
-
-#ifndef PACE_PTHREAD_ONCE_T
-#define PACE_PTHREAD_ONCE_T
- typedef int pthread_once_t; /* temporary */
- typedef pthread_once_t pace_pthread_once_t;
-#endif /* PACE_PTHREAD_ONCE_T */
-
-#ifndef PACE_PTHREAD_T
-#define PACE_PTHREAD_T
- typedef DWORD pace_pthread_t;
- typedef HANDLE pace_hpthread_t;
-#endif /* PACE_PTHREAD_T */
-
#ifndef PACE_SIZE_T
#define PACE_SIZE_T
typedef size_t pace_size_t;
@@ -141,6 +93,8 @@ extern "C" {
typedef uid_t pace_uid_t;
#endif /* PACE_UID_T */
+#include "pace/win32/pthreadtypes.h"
+
#if defined (PACE_HAS_CPLUSPLUS)
}
#endif /* PACE_HAS_CPLUSPLUS */