Mercurial > emacs
comparison src/alloc.c @ 90737:95d0cdf160ea
Merge from emacs--devo--0
Patches applied:
* emacs--devo--0 (patch 586-614)
- Update from CVS
- Update from erc--emacs--22
- Merge from gnus--rel--5.10
- Merge from erc--main--0
- Make byte compiler correctly write circular constants
* gnus--rel--5.10 (patch 186-196)
- Update from CVS
- Merge from emacs--devo--0
Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-162
| author | Miles Bader <miles@gnu.org> |
|---|---|
| date | Fri, 26 Jan 2007 06:16:11 +0000 |
| parents | dbe3f29e61d6 3d45362f1d38 |
| children | f83d17e1ace6 |
comparison
equal
deleted
inserted
replaced
| 90736:ef1369583937 | 90737:95d0cdf160ea |
|---|---|
| 1 /* Storage allocation and gc for GNU Emacs Lisp interpreter. | 1 /* Storage allocation and gc for GNU Emacs Lisp interpreter. |
| 2 Copyright (C) 1985, 1986, 1988, 1993, 1994, 1995, 1997, 1998, 1999, | 2 Copyright (C) 1985, 1986, 1988, 1993, 1994, 1995, 1997, 1998, 1999, |
| 3 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. | 3 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. |
| 4 | 4 |
| 5 This file is part of GNU Emacs. | 5 This file is part of GNU Emacs. |
| 6 | 6 |
| 7 GNU Emacs is free software; you can redistribute it and/or modify | 7 GNU Emacs is free software; you can redistribute it and/or modify |
| 8 it under the terms of the GNU General Public License as published by | 8 it under the terms of the GNU General Public License as published by |
| 125 to run Emacs code at once, and the code is not prepared for that. | 125 to run Emacs code at once, and the code is not prepared for that. |
| 126 To prevent that, we only call BLOCK/UNBLOCK from the main thread. */ | 126 To prevent that, we only call BLOCK/UNBLOCK from the main thread. */ |
| 127 | 127 |
| 128 static pthread_mutex_t alloc_mutex; | 128 static pthread_mutex_t alloc_mutex; |
| 129 | 129 |
| 130 #define BLOCK_INPUT_ALLOC \ | 130 #define BLOCK_INPUT_ALLOC \ |
| 131 do \ | 131 do \ |
| 132 { \ | 132 { \ |
| 133 if (pthread_self () == main_thread) \ | 133 if (pthread_equal (pthread_self (), main_thread)) \ |
| 134 BLOCK_INPUT; \ | 134 sigblock (sigmask (SIGIO)); \ |
| 135 pthread_mutex_lock (&alloc_mutex); \ | 135 pthread_mutex_lock (&alloc_mutex); \ |
| 136 } \ | 136 } \ |
| 137 while (0) | 137 while (0) |
| 138 #define UNBLOCK_INPUT_ALLOC \ | 138 #define UNBLOCK_INPUT_ALLOC \ |
| 139 do \ | 139 do \ |
| 140 { \ | 140 { \ |
| 141 pthread_mutex_unlock (&alloc_mutex); \ | 141 pthread_mutex_unlock (&alloc_mutex); \ |
| 142 if (pthread_self () == main_thread) \ | 142 if (pthread_equal (pthread_self (), main_thread)) \ |
| 143 UNBLOCK_INPUT; \ | 143 sigunblock (sigmask (SIGIO)); \ |
| 144 } \ | 144 } \ |
| 145 while (0) | 145 while (0) |
| 146 | 146 |
| 147 #else /* SYSTEM_MALLOC || not HAVE_GTK_AND_PTHREAD */ | 147 #else /* SYSTEM_MALLOC || not HAVE_GTK_AND_PTHREAD */ |
| 148 | 148 |
| 149 #define BLOCK_INPUT_ALLOC BLOCK_INPUT | 149 #define BLOCK_INPUT_ALLOC BLOCK_INPUT |
