Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 1 Jun 2016 21:58:13 +0000 (UTC)
From:      Jilles Tjoelker <jilles@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r301171 - head/lib/libc/sys
Message-ID:  <201606012158.u51LwD1D052954@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jilles
Date: Wed Jun  1 21:58:13 2016
New Revision: 301171
URL: https://svnweb.freebsd.org/changeset/base/301171

Log:
  thr_*(2): Add xrefs to what libthr implements using each syscall.
  
  Add text to thr_exit(2) and thr_new(2) discouraging their use in
  applications since calling these in a process with libthr loaded will
  confuse libthr and is likely to cause hangs or crashes.
  
  The thr_kill2(2) call is not used by libthr and may be useful in special
  applications.
  
  The other calls can be used in applications but it should not be necessary.

Modified:
  head/lib/libc/sys/thr_exit.2
  head/lib/libc/sys/thr_kill.2
  head/lib/libc/sys/thr_new.2
  head/lib/libc/sys/thr_self.2
  head/lib/libc/sys/thr_set_name.2

Modified: head/lib/libc/sys/thr_exit.2
==============================================================================
--- head/lib/libc/sys/thr_exit.2	Wed Jun  1 21:52:12 2016	(r301170)
+++ head/lib/libc/sys/thr_exit.2	Wed Jun  1 21:58:13 2016	(r301171)
@@ -28,7 +28,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd May 5, 2016
+.Dd June 1, 2016
 .Dt THR_EXIT 2
 .Os
 .Sh NAME
@@ -41,6 +41,13 @@
 .Ft void
 .Fn thr_exit "long *state"
 .Sh DESCRIPTION
+.Bf -symbolic
+This function is intended for implementing threading.
+Normal applications should call
+.Xr pthread_exit 3
+instead.
+.Ef
+.Pp
 The
 .Fn thr_exit
 system call terminates the current kernel-scheduled thread.
@@ -70,7 +77,8 @@ last one in the process.
 .Xr thr_new 2 ,
 .Xr thr_self 2 ,
 .Xr thr_set_name 2 ,
-.Xr _umtx_op 2
+.Xr _umtx_op 2 ,
+.Xr pthread_exit 3
 .Sh STANDARDS
 The
 .Fn thr_exit

Modified: head/lib/libc/sys/thr_kill.2
==============================================================================
--- head/lib/libc/sys/thr_kill.2	Wed Jun  1 21:52:12 2016	(r301170)
+++ head/lib/libc/sys/thr_kill.2	Wed Jun  1 21:58:13 2016	(r301171)
@@ -28,7 +28,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd May 5, 2016
+.Dd June 1, 2016
 .Dt THR_kill 2
 .Os
 .Sh NAME
@@ -112,11 +112,13 @@ The current process does not have suffic
 send a signal to the specified process.
 .El
 .Sh SEE ALSO
+.Xr kill 2 ,
 .Xr thr_exit 2 ,
 .Xr thr_new 2 ,
 .Xr thr_self 2 ,
 .Xr thr_set_name 2 ,
 .Xr _umtx_op 2 ,
+.Xr pthread_kill 3 ,
 .Xr signal 3
 .Sh STANDARDS
 The

Modified: head/lib/libc/sys/thr_new.2
==============================================================================
--- head/lib/libc/sys/thr_new.2	Wed Jun  1 21:52:12 2016	(r301170)
+++ head/lib/libc/sys/thr_new.2	Wed Jun  1 21:58:13 2016	(r301171)
@@ -28,7 +28,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd May 5, 2016
+.Dd June 1, 2016
 .Dt THR_NEW 2
 .Os
 .Sh NAME
@@ -41,6 +41,13 @@
 .Ft int
 .Fn thr_new "struct thr_param *param" "int param_size"
 .Sh DESCRIPTION
+.Bf -symbolic
+This function is intended for implementing threading.
+Normal applications should call
+.Xr pthread_create 3
+instead.
+.Ef
+.Pp
 The
 .Fn thr_new
 system call creates a new kernel-scheduled thread of execution in the context
@@ -220,7 +227,8 @@ No kernel memory to allocate for the new
 .Xr thr_kill2 2 ,
 .Xr thr_self 2 ,
 .Xr thr_set_name 2 ,
-.Xr _umtx_op 2
+.Xr _umtx_op 2 ,
+.Xr pthread_create 3
 .Sh STANDARDS
 The
 .Fn thr_new

Modified: head/lib/libc/sys/thr_self.2
==============================================================================
--- head/lib/libc/sys/thr_self.2	Wed Jun  1 21:52:12 2016	(r301170)
+++ head/lib/libc/sys/thr_self.2	Wed Jun  1 21:58:13 2016	(r301171)
@@ -28,7 +28,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd May 5, 2016
+.Dd June 1, 2016
 .Dt THR_SELF 2
 .Os
 .Sh NAME
@@ -76,7 +76,9 @@ argument is not valid.
 .Xr thr_kill2 2 ,
 .Xr thr_new 2 ,
 .Xr thr_set_name 2 ,
-.Xr _umtx_op 2
+.Xr _umtx_op 2 ,
+.Xr pthread_getthreadid_np 3 ,
+.Xr pthread_self 3
 .Sh STANDARDS
 The
 .Fn thr_self

Modified: head/lib/libc/sys/thr_set_name.2
==============================================================================
--- head/lib/libc/sys/thr_set_name.2	Wed Jun  1 21:52:12 2016	(r301170)
+++ head/lib/libc/sys/thr_set_name.2	Wed Jun  1 21:58:13 2016	(r301171)
@@ -28,7 +28,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd May 5, 2016
+.Dd June 1, 2016
 .Dt THR_SET_NAME 2
 .Os
 .Sh NAME
@@ -87,6 +87,7 @@ does not exist in the current process.
 .Xr thr_new 2 ,
 .Xr thr_self 2 ,
 .Xr _umtx_op 2 ,
+.Xr pthread_set_name_np 3 ,
 .Xr ddb 4 ,
 .Xr ktr 9
 .Sh STANDARDS



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201606012158.u51LwD1D052954>