pthread_switch_add_np.3 (110827) | pthread_switch_add_np.3 (111447) |
---|---|
1.\" Copyright (c) 2003 Alexey Zelkin <phantom@FreeBSD.org> 2.\" All rights reserved. 3.\" 4.\" Redistribution and use in source and binary forms, with or without 5.\" modification, are permitted provided that the following conditions 6.\" are met: 7.\" 1. Redistributions of source code must retain the above copyright 8.\" notice, this list of conditions and the following disclaimer. --- 8 unchanged lines hidden (view full) --- 17.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 18.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 20.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 21.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 22.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 23.\" SUCH DAMAGE. 24.\" | 1.\" Copyright (c) 2003 Alexey Zelkin <phantom@FreeBSD.org> 2.\" All rights reserved. 3.\" 4.\" Redistribution and use in source and binary forms, with or without 5.\" modification, are permitted provided that the following conditions 6.\" are met: 7.\" 1. Redistributions of source code must retain the above copyright 8.\" notice, this list of conditions and the following disclaimer. --- 8 unchanged lines hidden (view full) --- 17.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 18.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 20.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 21.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 22.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 23.\" SUCH DAMAGE. 24.\" |
25.\" $FreeBSD: head/share/man/man3/pthread_switch_add_np.3 110827 2003-02-13 22:10:10Z phantom $ | 25.\" $FreeBSD: head/share/man/man3/pthread_switch_add_np.3 111447 2003-02-24 22:53:26Z ru $ |
26.\" 27.Dd February 13, 2003 28.Dt PTHREAD_SWITCH_ADD_NP 3 29.Os 30.Sh NAME 31.Nm pthread_switch_add_np , 32.Nm pthread_switch_delete_np | 26.\" 27.Dd February 13, 2003 28.Dt PTHREAD_SWITCH_ADD_NP 3 29.Os 30.Sh NAME 31.Nm pthread_switch_add_np , 32.Nm pthread_switch_delete_np |
33.Nd threads context switches debugging primitives | 33.Nd thread context switches debugging primitives |
34.Sh LIBRARY 35.Lb libc_r 36.Sh SYNOPSIS 37.In pthread_np.h 38.Ft int 39.Fn pthread_switch_add_np "pthread_switch_routine_t routine" 40.Ft int 41.Fn pthread_switch_delete_np "pthread_switch_routine_t routine" 42.Sh DESCRIPTION | 34.Sh LIBRARY 35.Lb libc_r 36.Sh SYNOPSIS 37.In pthread_np.h 38.Ft int 39.Fn pthread_switch_add_np "pthread_switch_routine_t routine" 40.Ft int 41.Fn pthread_switch_delete_np "pthread_switch_routine_t routine" 42.Sh DESCRIPTION |
43The application is allowed to monitor thread context switches inside 44threading library. 45An application can install routine that gets called everytime a thread 46(explicitly created by the application with 47.Fn pthread_create 48function) gets context switched. 49This routine gets passed the pthread IDs of the threads that are | 43An application is allowed to monitor the thread context switches inside 44the threading library. 45An application can install a routine that gets called every time a thread 46(explicitly created by an application with the 47.Xr pthread_create 3 48function) gets the context switched. 49The routine is passed the thread IDs of the threads that are |
50being switched in and out. | 50being switched in and out. |
51Installation and removal of these hooks may be done using | 51Installation and removal of these hooks may be done using the |
52.Fn pthread_switch_add_np 53and 54.Fn pthread_switch_delete_np 55functions respectively. 56.Sh RETURN VALUES 57If successful, | 52.Fn pthread_switch_add_np 53and 54.Fn pthread_switch_delete_np 55functions respectively. 56.Sh RETURN VALUES 57If successful, |
58functions return 0. | 58these functions return 0. |
59Otherwise, an error number is returned to indicate the error. 60.Sh ERRORS 61The 62.Fn pthread_switch_add_np 63may fail if: 64.Bl -tag -width Er 65.It Bq Er EINVAL | 59Otherwise, an error number is returned to indicate the error. 60.Sh ERRORS 61The 62.Fn pthread_switch_add_np 63may fail if: 64.Bl -tag -width Er 65.It Bq Er EINVAL |
66NULL pointer passed as | 66.Dv NULL 67pointer was passed in the |
67.Fa routine 68argument. 69.El | 68.Fa routine 69argument. 70.El |
71.Pp |
|
70The 71.Fn pthread_switch_delete_np 72may fail if: 73.Bl -tag -width Er 74.It Bq Er EINVAL | 72The 73.Fn pthread_switch_delete_np 74may fail if: 75.Bl -tag -width Er 76.It Bq Er EINVAL |
77The |
|
75.Fa routine | 78.Fa routine |
76argument is different from argument previously passed to | 79argument is different from the argument previously passed to the |
77.Fn pthread_switch_add_np | 80.Fn pthread_switch_add_np |
81function. |
|
78.El 79.Sh SEE ALSO 80.Xr pthread_create 3 81.Sh AUTHORS | 82.El 83.Sh SEE ALSO 84.Xr pthread_create 3 85.Sh AUTHORS |
82The 83.Nm 84manpage was written by 85.An Alexey Zelkin 86.Aq phantom@FreeBSD.org 87 | 86This manual page was written by 87.An Alexey Zelkin Aq phantom@FreeBSD.org . |