emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/src/alloc.c


From: Jan Djärv
Subject: [Emacs-diffs] Changes to emacs/src/alloc.c
Date: Wed, 15 Dec 2004 18:51:45 -0500

Index: emacs/src/alloc.c
diff -c emacs/src/alloc.c:1.355 emacs/src/alloc.c:1.356
*** emacs/src/alloc.c:1.355     Tue Dec  7 17:38:30 2004
--- emacs/src/alloc.c   Wed Dec 15 21:40:39 2004
***************
*** 99,105 ****
     If Emacs sets malloc hooks (! SYSTEM_MALLOC) and the emacs_blocked_*
     functions below are called from malloc, there is a chance that one
     of these threads preempts the Emacs main thread and the hook variables
!    end up in a inconsistent state.  So we have a mutex to prevent that (note
     that the backend handles concurrent access to malloc within its own threads
     but Emacs code running in the main thread is not included in that control).
  
--- 99,105 ----
     If Emacs sets malloc hooks (! SYSTEM_MALLOC) and the emacs_blocked_*
     functions below are called from malloc, there is a chance that one
     of these threads preempts the Emacs main thread and the hook variables
!    end up in an inconsistent state.  So we have a mutex to prevent that (note
     that the backend handles concurrent access to malloc within its own threads
     but Emacs code running in the main thread is not included in that control).
  
***************
*** 109,115 ****
     To prevent that, we only call BLOCK/UNBLOCK from the main thread.  */
  
  static pthread_mutex_t alloc_mutex;
- pthread_t main_thread;
  
  #define BLOCK_INPUT_ALLOC                       \
    do                                            \
--- 109,114 ----
***************
*** 1310,1317 ****
    pthread_mutexattr_init (&attr);
    pthread_mutexattr_settype (&attr, PTHREAD_MUTEX_RECURSIVE);
    pthread_mutex_init (&alloc_mutex, &attr);
- 
-   main_thread = pthread_self ();
  #endif /* HAVE_GTK_AND_PTHREAD */
  
    if (__free_hook != emacs_blocked_free)
--- 1309,1314 ----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]