summaryrefslogtreecommitdiff
path: root/src/thread.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/thread.c')
-rw-r--r--src/thread.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/thread.c b/src/thread.c
index 3e61723f0ab..6e9ca2e256b 100644
--- a/src/thread.c
+++ b/src/thread.c
@@ -55,7 +55,6 @@ release_global_lock (void)
static void
post_acquire_global_lock (struct thread_state *self)
{
- Lisp_Object buffer;
struct thread_state *prev_thread = current_thread;
/* Do this early on, so that code below could signal errors (e.g.,
@@ -71,12 +70,12 @@ post_acquire_global_lock (struct thread_state *self)
if (prev_thread != NULL)
unbind_for_thread_switch (prev_thread);
rebind_for_thread_switch ();
- }
- /* We need special handling to re-set the buffer. */
- XSETBUFFER (buffer, self->m_current_buffer);
- self->m_current_buffer = 0;
- set_buffer_internal (XBUFFER (buffer));
+ /* Set the new thread's current buffer. This needs to be done
+ even if it is the same buffer as that of the previous thread,
+ because of thread-local bindings. */
+ set_buffer_internal_2 (current_buffer);
+ }
if (!NILP (current_thread->error_symbol))
{