if (!BUFFER_LIVE_P (b))
return Qnil;
+ if (thread_check_current_buffer (b))
+ return Qnil;
+
/* Query if the buffer is still modified. */
if (INTERACTIVE && !NILP (BVAR (b, filename))
&& BUF_MODIFF (b) > BUF_SAVE_MODIFF (b))
\f
+int
+thread_check_current_buffer (struct buffer *buffer)
+{
+ struct thread_state *iter;
+
+ for (iter = all_threads; iter; iter = iter->next_thread)
+ {
+ if (iter == current_thread)
+ continue;
+
+ if (iter->m_current_buffer == buffer)
+ return 1;
+ }
+
+ return 0;
+}
+
+\f
+
static void
init_primary_thread (void)
{
SELECT_TYPE *wfds, SELECT_TYPE *efds, EMACS_TIME *timeout,
sigset_t *sigmask);
+int thread_check_current_buffer (struct buffer *);
+
#endif /* THREAD_H */