Deleted Added
full compact
pthread_spin_init.3 (124837) pthread_spin_init.3 (130643)
1.\" Copyright (c) 2004 Michael Telahun Makonnen
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) 2004 Michael Telahun Makonnen
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_spin_init.3 124837 2004-01-22 15:31:56Z mtm $
25.\" $FreeBSD: head/share/man/man3/pthread_spin_init.3 130643 2004-06-17 17:51:17Z ru $
26.\"
26.\"
27.\" Note: The date here should be updated whenever a non-trivial
28.\" change is made to the manual page.
29.Dd January 22, 2004
27.Dd January 22, 2004
30.Dt PTHREAD_SPIN_INIT 3 PTHREAD_SPIN_DESTROY 3
28.Dt PTHREAD_SPIN_INIT 3
31.Os
32.Sh NAME
29.Os
30.Sh NAME
33.Nm pthread_spin_init pthread_spin_destroy
31.Nm pthread_spin_init , pthread_spin_destroy
34.Nd "initialize or destroy a spin lock"
35.Sh LIBRARY
36.Lb libpthread
37.Lb libthr
38.Sh SYNOPSIS
39.In pthread.h
40.Ft int
41.Fn pthread_spin_init "pthread_spinlock_t *lock" "int pshared"

--- 4 unchanged lines hidden (view full) ---

46.Fn pthread_spin_init
47function will initialize
48.Fa lock
49to an unlocked state and
50allocate any resources necessary to begin using it.
51If
52.Fa pshared
53is set to
32.Nd "initialize or destroy a spin lock"
33.Sh LIBRARY
34.Lb libpthread
35.Lb libthr
36.Sh SYNOPSIS
37.In pthread.h
38.Ft int
39.Fn pthread_spin_init "pthread_spinlock_t *lock" "int pshared"

--- 4 unchanged lines hidden (view full) ---

44.Fn pthread_spin_init
45function will initialize
46.Fa lock
47to an unlocked state and
48allocate any resources necessary to begin using it.
49If
50.Fa pshared
51is set to
54.Dv PTHREAD_PROCESS_SHARED
52.Dv PTHREAD_PROCESS_SHARED ,
55any thread,
56whether belonging to the process in which the spinlock was created or not,
57that has access to the memory area where
58.Fa lock
53any thread,
54whether belonging to the process in which the spinlock was created or not,
55that has access to the memory area where
56.Fa lock
59resides can use
57resides, can use
60.Fa lock .
61If it is set to
58.Fa lock .
59If it is set to
62.Dv PTHREAD_PROCESS_PRIVATE
60.Dv PTHREAD_PROCESS_PRIVATE ,
63it can only be used by threads within the same process.
64.Pp
65The
66.Fn pthread_spin_destroy
67function will destroy
68.Fa lock
69and release any resources that may have been allocated on its behalf.
61it can only be used by threads within the same process.
62.Pp
63The
64.Fn pthread_spin_destroy
65function will destroy
66.Fa lock
67and release any resources that may have been allocated on its behalf.
70.Pp
71.Sh DIAGNOSTICS
68.Sh RETURN VALUES
72If successful,
73both
74.Fn pthread_spin_init
75and
76.Fn pthread_spin_destroy
77will return zero.
69If successful,
70both
71.Fn pthread_spin_init
72and
73.Fn pthread_spin_destroy
74will return zero.
78Otherwise an error number will be returned to indicate the error.
75Otherwise, an error number will be returned to indicate the error.
79.Pp
76.Pp
80Neither of these functions will return EINTR.
81.Pp
77Neither of these functions will return
78.Er EINTR .
82.Sh ERRORS
83The
84.Fn pthread_spin_init
85and
86.Fn pthread_spin_destroy
87functions will fail if:
88.Bl -tag -width Er
89.It Bq Er EBUSY

--- 43 unchanged lines hidden (view full) ---

133because the
134.Fa pshared
135argument is ignored in
136.Lb libthr ,
137and in
138.Lb libpthread
139if any value other than
140.Dv PTHREAD_PROCESSES_PRIVATE
79.Sh ERRORS
80The
81.Fn pthread_spin_init
82and
83.Fn pthread_spin_destroy
84functions will fail if:
85.Bl -tag -width Er
86.It Bq Er EBUSY

--- 43 unchanged lines hidden (view full) ---

130because the
131.Fa pshared
132argument is ignored in
133.Lb libthr ,
134and in
135.Lb libpthread
136if any value other than
137.Dv PTHREAD_PROCESSES_PRIVATE
141is specified it returns EINVAL.
138is specified, it returns
139.Er EINVAL .