-extern volatile int notification_buffer_in_use;
-extern BYTE file_notifications[16384];
-extern DWORD notifications_size;
-extern void *notifications_desc;
+#define FILE_NOTIFICATIONS_SIZE 16384
+/* Notifications come in sets. We use a doubly linked list with a
+ sentinel to communicate those sets from the watching threads to the
+ main thread. */
+struct notifications_set {
+ LPBYTE notifications;
+ DWORD size;
+ void *desc;
+ struct notifications_set *next;
+ struct notifications_set *prev;
+};
+extern struct notifications_set *notifications_set_head;