- if (!notification_buffer_in_use)
- {
- if (info_size)
- memcpy (file_notifications, info, info_size);
- notifications_size = info_size;
- notifications_desc = desc;
- /* If PostMessage fails, the message queue is full. If that
- happens, the last thing they will worry about is file
- notifications. So we effectively discard the
- notification in that case. */
- if ((FRAME_TERMCAP_P (f)
- /* We send the message to the main (a.k.a. "Lisp")
- thread, where it will wake up MsgWaitForMultipleObjects
- inside sys_select, causing it to report that there's
- some keyboard input available. This will in turn cause
- w32_console_read_socket to be called, which will pick
- up the file notifications. */
- && PostThreadMessage (dwMainThreadId, WM_EMACS_FILENOTIFY, 0, 0))
- || (FRAME_W32_P (f)
- && PostMessage (FRAME_W32_WINDOW (f),
- WM_EMACS_FILENOTIFY, 0, 0))
- /* When we are running in batch mode, there's no one to
- send a message, so we just signal the data is
- available and hope sys_select will be called soon and
- will read the data. */
- || (FRAME_INITIAL_P (f) && noninteractive))
- notification_buffer_in_use = 1;
- done = 1;
- }
- leave_crit ();
- if (!done)
- Sleep (5);
- }
+ ns->next = notifications_set_head;
+ ns->prev = notifications_set_head->prev;
+ ns->prev->next = ns;
+ notifications_set_head->prev = ns;
+ leave_crit();
+
+ /* If PostMessage fails, the message queue is full. If that
+ happens, the last thing they will worry about is file
+ notifications. So we effectively discard the notification in
+ that case. */
+ if (FRAME_TERMCAP_P (f))
+ /* We send the message to the main (a.k.a. "Lisp") thread, where
+ it will wake up MsgWaitForMultipleObjects inside sys_select,
+ causing it to report that there's some keyboard input
+ available. This will in turn cause w32_console_read_socket to
+ be called, which will pick up the file notifications. */
+ PostThreadMessage (dwMainThreadId, WM_EMACS_FILENOTIFY, 0, 0);
+ else if (FRAME_W32_P (f))
+ PostMessage (FRAME_W32_WINDOW (f),
+ WM_EMACS_FILENOTIFY, 0, 0);
+ /* When we are running in batch mode, there's no one to send a
+ message, so we just signal the data is available and hope
+ sys_select will be called soon and will read the data. */
+#if 0
+ else if (FRAME_INITIAL_P (f) && noninteractive)
+ ;
+#endif