From: Ulrich Drepper Date: Thu, 2 Dec 1999 18:27:19 +0000 (+0000) Subject: Really use already_called variable. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f0bb14aa7ffae673adf593b3a8667fd9c84b1cee;p=thirdparty%2Fglibc.git Really use already_called variable. --- diff --git a/malloc/set-freeres.c b/malloc/set-freeres.c index e73da87bf79..814bc4a55ed 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, ()); }