Mercurial > emacs
comparison src/alloc.c @ 83554:b8d9a391daf3
Merged from emacs@sv.gnu.org
Patches applied:
* emacs@sv.gnu.org/emacs--devo--0--patch-599
Merge from erc--main--0
* emacs@sv.gnu.org/emacs--devo--0--patch-600
Merge from erc--main--0
* emacs@sv.gnu.org/emacs--devo--0--patch-601
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-602
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-603
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-604
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-605
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-606
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-607
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-608
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-609
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-610
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-611
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-612
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-613
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-614
Make byte compiler correctly write circular constants
* emacs@sv.gnu.org/emacs--devo--0--patch-615
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-616
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-617
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-618
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-192
Merge from emacs--devo--0
* emacs@sv.gnu.org/gnus--rel--5.10--patch-193
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-194
Merge from emacs--devo--0
* emacs@sv.gnu.org/gnus--rel--5.10--patch-195
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-196
Update from CVS
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-594
| author | Karoly Lorentey <lorentey@elte.hu> |
|---|---|
| date | Mon, 29 Jan 2007 22:21:19 +0000 |
| parents | c71725faff1a b176aeeb7253 |
| children | dc002877ce12 |
comparison
equal
deleted
inserted
replaced
| 83553:32073cbc5eb6 | 83554:b8d9a391daf3 |
|---|---|
| 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 BLOCK_INPUT; \ |
| 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 UNBLOCK_INPUT; \ |
| 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 |
