move __abort_lock to its own file and drop pointless weak_alias trick
authorRich Felker <dalias@aerifal.cx>
Mon, 28 Sep 2020 23:30:19 +0000 (19:30 -0400)
committerRich Felker <dalias@aerifal.cx>
Thu, 15 Oct 2020 00:27:12 +0000 (20:27 -0400)
the dummy definition of __abort_lock in sigaction.c was performing
exactly the same role that putting the lock in its own source file
could and should have been used to achieve.

while we're moving it, give it a proper declaration.

src/exit/abort.c
src/exit/abort_lock.c [new file with mode: 0644]
src/internal/pthread_impl.h
src/signal/sigaction.c

index e1980f1..f21f458 100644 (file)
@@ -6,8 +6,6 @@
 #include "lock.h"
 #include "ksigaction.h"
 
-hidden volatile int __abort_lock[1];
-
 _Noreturn void abort(void)
 {
        raise(SIGABRT);
diff --git a/src/exit/abort_lock.c b/src/exit/abort_lock.c
new file mode 100644 (file)
index 0000000..3af72c7
--- /dev/null
@@ -0,0 +1,3 @@
+#include "pthread_impl.h"
+
+volatile int __abort_lock[1];
index 358ad1c..10e2988 100644 (file)
@@ -196,6 +196,8 @@ hidden void __tl_sync(pthread_t);
 
 extern hidden volatile int __thread_list_lock;
 
+extern hidden volatile int __abort_lock[1];
+
 extern hidden unsigned __default_stacksize;
 extern hidden unsigned __default_guardsize;
 
index c109bea..a473740 100644 (file)
@@ -7,12 +7,6 @@
 #include "lock.h"
 #include "ksigaction.h"
 
-static volatile int dummy_lock[1] = { 0 };
-
-extern hidden volatile int __abort_lock[1];
-
-weak_alias(dummy_lock, __abort_lock);
-
 static int unmask_done;
 static unsigned long handler_set[_NSIG/(8*sizeof(long))];