Module Name:    src
Committed By:   kamil
Date:           Tue Sep 10 22:34:19 UTC 2019

Modified Files:
        src/lib/libpthread: thrd.c threads.h

Log Message:
Switch back _Noreturn to __dead in C11 threads

There is an ongoing discussion to unify unreturn attribute between C and
C++, making a compatible version, shared between languages. Instead of
picking C11-only approach here, switch back to __dead that wraps the
compiler extension for the same purpose.

This change makes this header more compatible with C++ and pre-C11.

Reference:

http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2410.pdf


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/lib/libpthread/thrd.c
cvs rdiff -u -r1.2 -r1.3 src/lib/libpthread/threads.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libpthread/thrd.c
diff -u src/lib/libpthread/thrd.c:1.3 src/lib/libpthread/thrd.c:1.4
--- src/lib/libpthread/thrd.c:1.3	Mon Apr 29 20:11:43 2019
+++ src/lib/libpthread/thrd.c	Tue Sep 10 22:34:19 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: thrd.c,v 1.3 2019/04/29 20:11:43 kamil Exp $	*/
+/*	$NetBSD: thrd.c,v 1.4 2019/09/10 22:34:19 kamil Exp $	*/
 
 /*-
  * Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: thrd.c,v 1.3 2019/04/29 20:11:43 kamil Exp $");
+__RCSID("$NetBSD: thrd.c,v 1.4 2019/09/10 22:34:19 kamil Exp $");
 
 #include <assert.h>
 #include <errno.h>
@@ -122,7 +122,7 @@ thrd_equal(thrd_t t1, thrd_t t2)
 	return pthread_equal(t1, t2);
 }
 
-_Noreturn void
+__dead void
 thrd_exit(int res)
 {
 

Index: src/lib/libpthread/threads.h
diff -u src/lib/libpthread/threads.h:1.2 src/lib/libpthread/threads.h:1.3
--- src/lib/libpthread/threads.h:1.2	Wed Apr 24 18:47:54 2019
+++ src/lib/libpthread/threads.h	Tue Sep 10 22:34:19 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: threads.h,v 1.2 2019/04/24 18:47:54 kamil Exp $	*/
+/*	$NetBSD: threads.h,v 1.3 2019/09/10 22:34:19 kamil Exp $	*/
 
 /*-
  * Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -106,7 +106,7 @@ int	thrd_create(thrd_t *, thrd_start_t, 
 thrd_t	thrd_current(void);
 int	thrd_detach(thrd_t);
 int	thrd_equal(thrd_t, thrd_t);
-_Noreturn void	thrd_exit(int);
+__dead void	thrd_exit(int);
 int	thrd_join(thrd_t, int *);
 int	thrd_sleep(const struct timespec *, struct timespec *);
 void	thrd_yield(void);

Reply via email to