summaryrefslogtreecommitdiff
path: root/lib/librthread/rthread.h
diff options
context:
space:
mode:
authorMarco Peereboom <marco@cvs.openbsd.org>2005-12-19 21:30:11 +0000
committerMarco Peereboom <marco@cvs.openbsd.org>2005-12-19 21:30:11 +0000
commit8a506a17e82b35a1f7c64e5f12d0209684db28d6 (patch)
tree967c219e51771a4b9dc965fc5ef579723385c1ab /lib/librthread/rthread.h
parent67622060e6bd6cdf1ecf9436b690274618883df7 (diff)
Fix hppa ldcw alignment issue.
Help deraadt, tedu, kettenis Ok tedu, kettenis
Diffstat (limited to 'lib/librthread/rthread.h')
-rw-r--r--lib/librthread/rthread.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/librthread/rthread.h b/lib/librthread/rthread.h
index 96596cce16a..6da13075dfd 100644
--- a/lib/librthread/rthread.h
+++ b/lib/librthread/rthread.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: rthread.h,v 1.8 2005/12/19 06:47:40 tedu Exp $ */
+/* $OpenBSD: rthread.h,v 1.9 2005/12/19 21:30:10 marco Exp $ */
/*
* Copyright (c) 2004,2005 Ted Unangst <tedu@openbsd.org>
* All Rights Reserved.
@@ -19,6 +19,10 @@
* Private data structures that back up the typedefs in pthread.h.
* Since only the thread library cares about their size or arrangement,
* it should be possible to switch libraries without relinking.
+ *
+ * Do not reorder _spinlock_lock_t and sem_t variables in the structs.
+ * This is due to alignment requirements of certain arches like hppa.
+ * The current requirement is 16 bytes.
*/
struct stack {
@@ -28,9 +32,10 @@ struct stack {
};
typedef struct semaphore {
+ _spinlock_lock_t lock;
volatile int waitcount;
volatile int value;
- _spinlock_lock_t lock;
+ int pad;
} *sem_t;
struct pthread_mutex {
@@ -53,10 +58,10 @@ struct pthread_cond_attr {
};
struct pthread_rwlock {
+ struct semaphore sem;
_spinlock_lock_t lock;
int readers;
int writer;
- struct semaphore sem;
};
struct pthread_rwlockattr {
@@ -91,8 +96,8 @@ struct rthread_cleanup_fn {
};
struct pthread {
- pid_t tid;
struct semaphore donesem;
+ pid_t tid;
unsigned int flags;
void *retval;
void *(*fn)(void *);