From 4a0f14bc365e9ed5fd7da31c740935273e69a0b7 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Wed, 1 Dec 1999 21:08:31 +0000 Subject: Update. * malloc/set-freeres.c: Really use already_called variable. --- malloc/set-freeres.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'malloc/set-freeres.c') diff --git a/malloc/set-freeres.c b/malloc/set-freeres.c index e73da87bf7..814bc4a55e 100644 --- a/malloc/set-freeres.c +++ b/malloc/set-freeres.c @@ -16,6 +16,7 @@ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include #include #include @@ -26,8 +27,8 @@ __libc_freeres (void) { /* This function might be called from different places. So better protect for multiple executions since these are fatal. */ - static int already_called; + static long int already_called; - if (!already_called) + if (compare_and_swap (&already_called, 0, 1)) RUN_HOOK (__libc_subfreeres, ()); } -- cgit v1.2.3