Update.
Showing
3 changed files
with
20 additions
and
3 deletions
... | @@ -19,7 +19,7 @@ | ... | @@ -19,7 +19,7 @@ |
19 | #define _MAILUTILS_MBOX_H | 19 | #define _MAILUTILS_MBOX_H |
20 | 20 | ||
21 | #include <mailutils/message.h> | 21 | #include <mailutils/message.h> |
22 | #include <mailutils/observer.h> | 22 | #include <mailutils/observable.h> |
23 | 23 | ||
24 | #ifdef __cplusplus | 24 | #ifdef __cplusplus |
25 | extern "C" { | 25 | extern "C" { | ... | ... |
... | @@ -50,7 +50,7 @@ | ... | @@ -50,7 +50,7 @@ |
50 | # define monitor_cleanup_push(routine, arg) { | 50 | # define monitor_cleanup_push(routine, arg) { |
51 | # define monitor_cleanup_pop(execute) } | 51 | # define monitor_cleanup_pop(execute) } |
52 | 52 | ||
53 | # define monitor_rdlock(m) (m = 1) | 53 | # define monitor_lock(m) (m = 1) |
54 | # define monitor_unlock(m) (m = 0) | 54 | # define monitor_unlock(m) (m = 0) |
55 | 55 | ||
56 | #endif | 56 | #endif | ... | ... |
... | @@ -19,6 +19,8 @@ | ... | @@ -19,6 +19,8 @@ |
19 | #define _MAILUTILS_SYS_MBOX_H | 19 | #define _MAILUTILS_SYS_MBOX_H |
20 | 20 | ||
21 | #include <time.h> | 21 | #include <time.h> |
22 | #include <mailutils/monitor.h> | ||
23 | #include <mailutils/locker.h> | ||
22 | #include <mailutils/mbox.h> | 24 | #include <mailutils/mbox.h> |
23 | 25 | ||
24 | #ifdef __cplusplus | 26 | #ifdef __cplusplus |
... | @@ -122,9 +124,24 @@ struct _mbox | ... | @@ -122,9 +124,24 @@ struct _mbox |
122 | char *date; | 124 | char *date; |
123 | off_t off; | 125 | off_t off; |
124 | monitor_t lock; | 126 | monitor_t lock; |
125 | locker_t dotlock; | 127 | |
128 | mu_debug_t debug; | ||
129 | locker_t locker; | ||
130 | observable_t observable; | ||
126 | }; | 131 | }; |
127 | 132 | ||
133 | /* Moro(?)ic kluge. */ | ||
134 | #define MBOX_DEBUG0(mbox, type, format) \ | ||
135 | if (mbox->debug) mu_debug_print (mbox->debug, type, format) | ||
136 | #define MBOX_DEBUG1(mbox, type, format, arg1) \ | ||
137 | if (mbox->debug) mu_debug_print (mbox->debug, type, format, arg1) | ||
138 | #define MBOX_DEBUG2(mbox, type, format, arg1, arg2) \ | ||
139 | if (mbox->debug) mu_debug_print (mbox->debug, type, format, arg1, arg2) | ||
140 | #define MBOX_DEBUG3(mbox, type, format, arg1, arg2, arg3) \ | ||
141 | if (mbox->debug) mu_debug_print (mbox->debug, type, format, arg1, arg2, arg3) | ||
142 | #define MBOX_DEBUG4(mbox, type, format, arg1, arg2, arg3, arg4) \ | ||
143 | if (mbox->debug) mu_debug_print (mbox->debug, type, format, arg1, arg2, arg3, arg4) | ||
144 | |||
128 | #ifdef __cplusplus | 145 | #ifdef __cplusplus |
129 | } | 146 | } |
130 | #endif | 147 | #endif | ... | ... |
-
Please register or sign in to post a comment