Skip to content
Snippets Groups Projects
Commit 3a7a6f80 authored by Avi Kivity's avatar Avi Kivity
Browse files

sched: reduce the size of a mutex

Pack the mutex by placing small fields next to each other.  This fixes
sizeof(cond_var) becoming larger than sizeof(pthread_cond_t), and corrupting
memory.
parent f12fa285
No related branches found
No related tags found
No related merge requests found
......@@ -21,12 +21,12 @@ static inline void spinlock_init(spinlock_t *sl)
struct cmutex {
bool _locked;
spinlock_t _wait_lock;
void *_owner;
struct wait_list {
struct waiter *first;
struct waiter *last;
} _wait_list;
spinlock_t _wait_lock;
};
typedef struct cmutex mutex_t;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment