[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH gnumach 2/2] ipc: use a general lock to protect IPC spaces
From: |
Justus Winter |
Subject: |
[PATCH gnumach 2/2] ipc: use a general lock to protect IPC spaces |
Date: |
Wed, 15 Jul 2015 15:24:30 +0200 |
This fixes a corruption in the radix trees representing the IPC spaces
when memory was tight.
* ipc/ipc_space.h: Use a general lock to protect IPC spaces.
---
ipc/ipc_space.h | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/ipc/ipc_space.h b/ipc/ipc_space.h
index bbfee46..73c90ef 100644
--- a/ipc/ipc_space.h
+++ b/ipc/ipc_space.h
@@ -62,7 +62,7 @@ struct ipc_space {
decl_simple_lock_data(,is_ref_lock_data)
ipc_space_refs_t is_references;
- decl_simple_lock_data(,is_lock_data)
+ struct lock is_lock_data;
boolean_t is_active; /* is the space alive? */
struct rdxtree is_map; /* a map of entries */
size_t is_size; /* number of entries */
@@ -107,16 +107,16 @@ MACRO_BEGIN
\
is_free(is); \
MACRO_END
-#define is_lock_init(is) simple_lock_init(&(is)->is_lock_data)
+#define is_lock_init(is) lock_init(&(is)->is_lock_data, TRUE)
-#define is_read_lock(is) simple_lock(&(is)->is_lock_data)
-#define is_read_unlock(is) simple_unlock(&(is)->is_lock_data)
+#define is_read_lock(is) lock_read(&(is)->is_lock_data)
+#define is_read_unlock(is) lock_done(&(is)->is_lock_data)
-#define is_write_lock(is) simple_lock(&(is)->is_lock_data)
-#define is_write_lock_try(is) simple_lock_try(&(is)->is_lock_data)
-#define is_write_unlock(is) simple_unlock(&(is)->is_lock_data)
+#define is_write_lock(is) lock_write(&(is)->is_lock_data)
+#define is_write_lock_try(is) lock_try_write(&(is)->is_lock_data)
+#define is_write_unlock(is) lock_done(&(is)->is_lock_data)
-#define is_write_to_read_lock(is)
+#define is_write_to_read_lock(is)
lock_write_to_read(&(is)->is_lock_data)
extern void ipc_space_reference(struct ipc_space *space);
extern void ipc_space_release(struct ipc_space *space);
--
2.1.4
- Re: new hurd & gnumach packages, (continued)
- Re: new hurd & gnumach packages, Samuel Thibault, 2015/07/06
- Re: new hurd & gnumach packages, Samuel Thibault, 2015/07/06
- Re: new hurd & gnumach packages, Richard Braun, 2015/07/06
- Re: new hurd & gnumach packages, Samuel Thibault, 2015/07/06
- Re: new hurd & gnumach packages, Samuel Thibault, 2015/07/06
- Re: new hurd & gnumach packages, Richard Braun, 2015/07/07
- Re: new hurd & gnumach packages, Samuel Thibault, 2015/07/07
- Re: new hurd & gnumach packages, Richard Braun, 2015/07/07
- Re: new hurd & gnumach packages, Richard Braun, 2015/07/15
- [PATCH gnumach 1/2] ipc: fix the locking of the IPC entry allocation functions, Justus Winter, 2015/07/15
- [PATCH gnumach 2/2] ipc: use a general lock to protect IPC spaces,
Justus Winter <=
- Re: [PATCH gnumach 2/2] ipc: use a general lock to protect IPC spaces, Richard Braun, 2015/07/16
- Re: [PATCH gnumach 2/2] ipc: use a general lock to protect IPC spaces, Richard Braun, 2015/07/17
- Re: [PATCH gnumach 2/2] ipc: use a general lock to protect IPC spaces, Richard Braun, 2015/07/17
- Re: [PATCH gnumach 2/2] ipc: use a general lock to protect IPC spaces, Justus Winter, 2015/07/17
- Re: new hurd & gnumach packages, Samuel Thibault, 2015/07/07
- Re: new hurd & gnumach packages, Richard Braun, 2015/07/08
- Re: new hurd & gnumach packages, Samuel Thibault, 2015/07/08