| 1 |
.\" |
| 2 |
.\" Copyright 2013 Samy Al Bahra. |
| 3 |
.\" All rights reserved. |
| 4 |
.\" |
| 5 |
.\" Redistribution and use in source and binary forms, with or without |
| 6 |
.\" modification, are permitted provided that the following conditions |
| 7 |
.\" are met: |
| 8 |
.\" 1. Redistributions of source code must retain the above copyright |
| 9 |
.\" notice, this list of conditions and the following disclaimer. |
| 10 |
.\" 2. Redistributions in binary form must reproduce the above copyright |
| 11 |
.\" notice, this list of conditions and the following disclaimer in the |
| 12 |
.\" documentation and/or other materials provided with the distribution. |
| 13 |
.\" |
| 14 |
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND |
| 15 |
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 16 |
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
| 17 |
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE |
| 18 |
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
| 19 |
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
| 20 |
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
| 21 |
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
| 22 |
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
| 23 |
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
| 24 |
.\" SUCH DAMAGE. |
| 25 |
.\" |
| 26 |
.\" |
| 27 |
.Dd April 7, 2013 |
| 28 |
.Dt ck_pr_neg 3 |
| 29 |
.Sh NAME |
| 30 |
.Nm ck_pr_neg_ptr , |
| 31 |
.Nm ck_pr_neg_ptr_zero , |
| 32 |
.Nm ck_pr_neg_double , |
| 33 |
.Nm ck_pr_neg_double_zero , |
| 34 |
.Nm ck_pr_neg_char , |
| 35 |
.Nm ck_pr_neg_char_zero , |
| 36 |
.Nm ck_pr_neg_uint , |
| 37 |
.Nm ck_pr_neg_uint_zero , |
| 38 |
.Nm ck_pr_neg_int , |
| 39 |
.Nm ck_pr_neg_int_zero , |
| 40 |
.Nm ck_pr_neg_64 , |
| 41 |
.Nm ck_pr_neg_64_zero , |
| 42 |
.Nm ck_pr_neg_32 , |
| 43 |
.Nm ck_pr_neg_32_zero , |
| 44 |
.Nm ck_pr_neg_16 , |
| 45 |
.Nm ck_pr_neg_16_zero , |
| 46 |
.Nm ck_pr_neg_8 , |
| 47 |
.Nm ck_pr_neg_8_zero |
| 48 |
.Nd atomic negation operations |
| 49 |
.Sh LIBRARY |
| 50 |
Concurrency Kit (libck, \-lck) |
| 51 |
.Sh SYNOPSIS |
| 52 |
.In ck_pr.h |
| 53 |
.Ft void |
| 54 |
.Fn ck_pr_neg_ptr "void *target" |
| 55 |
.Ft void |
| 56 |
.Fn ck_pr_neg_ptr_zero "void *target" "bool *z" |
| 57 |
.Ft void |
| 58 |
.Fn ck_pr_neg_double "double *target" |
| 59 |
.Ft void |
| 60 |
.Fn ck_pr_neg_double_zero "double *target" "bool *z" |
| 61 |
.Ft void |
| 62 |
.Fn ck_pr_neg_char "char *target" |
| 63 |
.Ft void |
| 64 |
.Fn ck_pr_neg_char_zero "char *target" "bool *z" |
| 65 |
.Ft void |
| 66 |
.Fn ck_pr_neg_uint "unsigned int *target" |
| 67 |
.Ft void |
| 68 |
.Fn ck_pr_neg_uint_zero "unsigned int *target" "bool *z" |
| 69 |
.Ft void |
| 70 |
.Fn ck_pr_neg_int "int *target" |
| 71 |
.Ft void |
| 72 |
.Fn ck_pr_neg_int_zero "int *target" "bool *z" |
| 73 |
.Ft void |
| 74 |
.Fn ck_pr_neg_64 "uint64_t *target" |
| 75 |
.Ft void |
| 76 |
.Fn ck_pr_neg_64_zero "uint64_t *target" "bool *z" |
| 77 |
.Ft void |
| 78 |
.Fn ck_pr_neg_32 "uint32_t *target" |
| 79 |
.Ft void |
| 80 |
.Fn ck_pr_neg_32_zero "uint32_t *target" "bool *z" |
| 81 |
.Ft void |
| 82 |
.Fn ck_pr_neg_16 "uint16_t *target" |
| 83 |
.Ft void |
| 84 |
.Fn ck_pr_neg_16_zero "uint16_t *target" "bool *z" |
| 85 |
.Ft void |
| 86 |
.Fn ck_pr_neg_8 "uint8_t *target" |
| 87 |
.Ft void |
| 88 |
.Fn ck_pr_neg_8_zero "uint8_t *target" "bool *z" |
| 89 |
.Sh DESCRIPTION |
| 90 |
The |
| 91 |
.Fn ck_pr_neg 3 |
| 92 |
family of functions atomically negate the value pointed to |
| 93 |
by |
| 94 |
.Fa target . |
| 95 |
.Sh RETURN VALUES |
| 96 |
The ck_pr_neg_zero functions set the value pointed to by |
| 97 |
.Fa z |
| 98 |
if the result of the negation operation was 0. They set the |
| 99 |
pointed to value to false otherwise. |
| 100 |
.Sh SEE ALSO |
| 101 |
.Xr ck_pr_fence_load 3 , |
| 102 |
.Xr ck_pr_fence_load_depends 3 , |
| 103 |
.Xr ck_pr_fence_store 3 , |
| 104 |
.Xr ck_pr_fence_memory 3 , |
| 105 |
.Xr ck_pr_load 3 , |
| 106 |
.Xr ck_pr_store 3 , |
| 107 |
.Xr ck_pr_fas 3 , |
| 108 |
.Xr ck_pr_faa 3 , |
| 109 |
.Xr ck_pr_inc 3 , |
| 110 |
.Xr ck_pr_dec 3 , |
| 111 |
.Xr ck_pr_not 3 , |
| 112 |
.Xr ck_pr_add 3 , |
| 113 |
.Xr ck_pr_sub 3 , |
| 114 |
.Xr ck_pr_and 3 , |
| 115 |
.Xr ck_pr_or 3 , |
| 116 |
.Xr ck_pr_xor 3 , |
| 117 |
.Xr ck_pr_cas 3 , |
| 118 |
.Xr ck_pr_btc 3 , |
| 119 |
.Xr ck_pr_bts 3 , |
| 120 |
.Xr ck_pr_btr 3 |
| 121 |
.Pp |
| 122 |
Additional information available at http://concurrencykit.org/ |