patch-docs_man3_qbatomic_h_3 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. --- libqb-0.16.0.orig/docs/man3/qbatomic.h.3 2013-07-25 20:16:18.000000000 +0200
  2. +++ libqb-0.16.0/docs/man3/qbatomic.h.3 2013-09-09 05:26:31.415811269 +0200
  3. @@ -1,4 +1,4 @@
  4. -.TH "qbatomic.h" 3 "Thu Jul 25 2013" "Version 0.16.0" "libqb" \" -*- nroff -*-
  5. +.TH "qbatomic.h" 3 "Mon Sep 9 2013" "Version 0.16.0" "libqb" \" -*- nroff -*-
  6. .ad l
  7. .nh
  8. .SH NAME
  9. @@ -16,7 +16,7 @@ Basic atomic integer and pointer operati
  10. \fC#include <qb/qbconfig\&.h>\fP
  11. .br
  12. -.SS "Macros"
  13. +.SS "Defines"
  14. .in +1c
  15. .ti -1c
  16. @@ -92,10 +92,9 @@ You must not directly read integers or p
  17. If you are using those functions for anything apart from simple reference counting, you should really be aware of the implications of doing that\&. There are literally thousands of ways to shoot yourself in the foot\&. So if in doubt, use a pthread_mutex\&. If you don't know, what memory barriers are, do not use anything but \fBqb_atomic_int_inc()\fP and \fBqb_atomic_int_dec_and_test()\fP\&.
  18. .PP
  19. It is not safe to set an integer or pointer just by assigning to it, when it is concurrently accessed by other threads with the following functions\&. Use \fBqb_atomic_int_compare_and_exchange()\fP or \fBqb_atomic_pointer_compare_and_exchange()\fP respectively\&.
  20. -.SH "Macro Definition Documentation"
  21. +.SH "Define Documentation"
  22. .PP
  23. -.SS "#define qb_atomic_int_dec_and_test(atomic) (\fBqb_atomic_int_exchange_and_add\fP ((atomic), -1) == 1)"
  24. -
  25. +.SS "#define \fBqb_atomic_int_dec_and_test\fP(atomic) (\fBqb_atomic_int_exchange_and_add\fP ((atomic), -1) == 1)"
  26. .PP
  27. Atomically decrements the integer pointed to by atomic by 1\&. \fBParameters:\fP
  28. .RS 4
  29. @@ -108,15 +107,13 @@ QB_TRUE if the integer pointed to by ato
  30. .RE
  31. .PP
  32. -.SS "#define qb_atomic_int_get(atomic)"
  33. -\fBValue:\fP
  34. +.SS "#define \fBqb_atomic_int_get\fP(atomic)"\fBValue:\fP
  35. .PP
  36. .nf
  37. ((void) sizeof (char* [sizeof (*(atomic)) == sizeof (int32_t) ? 1 : -1]), \
  38. (qb_atomic_int_get) ((volatile int32_t QB_GNUC_MAY_ALIAS *) (volatile void *) (atomic)))
  39. .fi
  40. -.SS "#define qb_atomic_int_inc(atomic) (\fBqb_atomic_int_add\fP ((atomic), 1))"
  41. -
  42. +.SS "#define \fBqb_atomic_int_inc\fP(atomic) (\fBqb_atomic_int_add\fP ((atomic), 1))"
  43. .PP
  44. Atomically increments the integer pointed to by atomic by 1\&. \fBParameters:\fP
  45. .RS 4
  46. @@ -124,22 +121,19 @@ Atomically increments the integer pointe
  47. .RE
  48. .PP
  49. -.SS "#define qb_atomic_int_set(atomic, newval)"
  50. -\fBValue:\fP
  51. +.SS "#define \fBqb_atomic_int_set\fP(atomic, newval)"\fBValue:\fP
  52. .PP
  53. .nf
  54. ((void) sizeof (char* [sizeof (*(atomic)) == sizeof (int32_t) ? 1 : -1]), \
  55. (qb_atomic_int_set) ((volatile int32_t QB_GNUC_MAY_ALIAS *) (volatile void *) (atomic), (newval)))
  56. .fi
  57. -.SS "#define qb_atomic_pointer_get(atomic)"
  58. -\fBValue:\fP
  59. +.SS "#define \fBqb_atomic_pointer_get\fP(atomic)"\fBValue:\fP
  60. .PP
  61. .nf
  62. ((void) sizeof (char* [sizeof (*(atomic)) == sizeof (void*) ? 1 : -1]), \
  63. (qb_atomic_pointer_get) ((volatile void* QB_GNUC_MAY_ALIAS *) (volatile void *) (atomic)))
  64. .fi
  65. -.SS "#define qb_atomic_pointer_set(atomic, newval)"
  66. -\fBValue:\fP
  67. +.SS "#define \fBqb_atomic_pointer_set\fP(atomic, newval)"\fBValue:\fP
  68. .PP
  69. .nf
  70. ((void) sizeof (char* [sizeof (*(atomic)) == sizeof (void*) ? 1 : -1]), \
  71. @@ -147,10 +141,8 @@ Atomically increments the integer pointe
  72. .fi
  73. .SH "Function Documentation"
  74. .PP
  75. -.SS "void qb_atomic_init (void)"
  76. -
  77. -.SS "void qb_atomic_int_add (volatile int32_t \fBQB_GNUC_MAY_ALIAS\fP *atomic, int32_tval)"
  78. -
  79. +.SS "void \fBqb_atomic_init\fP (void)"
  80. +.SS "void \fBqb_atomic_int_add\fP (volatile int32_t \fBQB_GNUC_MAY_ALIAS\fP *atomic, int32_tval)"
  81. .PP
  82. Atomically adds val to the integer pointed to by atomic\&. Also acts as a memory barrier\&.
  83. .PP
  84. @@ -162,8 +154,7 @@ Atomically adds val to the integer point
  85. .RE
  86. .PP
  87. -.SS "int32_t qb_atomic_int_compare_and_exchange (volatile int32_t \fBQB_GNUC_MAY_ALIAS\fP *atomic, int32_toldval, int32_tnewval)"
  88. -
  89. +.SS "int32_t \fBqb_atomic_int_compare_and_exchange\fP (volatile int32_t \fBQB_GNUC_MAY_ALIAS\fP *atomic, int32_toldval, int32_tnewval)"
  90. .PP
  91. Compares oldval with the integer pointed to by atomic and if they are equal, atomically exchanges *atomic with newval\&. Also acts as a memory barrier\&.
  92. .PP
  93. @@ -182,8 +173,7 @@ QB_TRUE, if *atomic was equal oldval\&.
  94. .RE
  95. .PP
  96. -.SS "int32_t qb_atomic_int_exchange_and_add (volatile int32_t \fBQB_GNUC_MAY_ALIAS\fP *atomic, int32_tval)"
  97. -
  98. +.SS "int32_t \fBqb_atomic_int_exchange_and_add\fP (volatile int32_t \fBQB_GNUC_MAY_ALIAS\fP *atomic, int32_tval)"
  99. .PP
  100. Atomically adds val to the integer pointed to by atomic\&. It returns the value of *atomic just before the addition took place\&. Also acts as a memory barrier\&.
  101. .PP
  102. @@ -200,8 +190,7 @@ the value of *atomic before the addition
  103. .RE
  104. .PP
  105. -.SS "int32_t qb_atomic_int_get (volatile int32_t \fBQB_GNUC_MAY_ALIAS\fP *atomic)"
  106. -
  107. +.SS "int32_t \fBqb_atomic_int_get\fP (volatile int32_t \fBQB_GNUC_MAY_ALIAS\fP *atomic)"
  108. .PP
  109. Reads the value of the integer pointed to by atomic\&. Also acts as a memory barrier\&.
  110. .PP
  111. @@ -216,8 +205,7 @@ the value of atomic
  112. .RE
  113. .PP
  114. -.SS "void qb_atomic_int_set (volatile int32_t \fBQB_GNUC_MAY_ALIAS\fP *atomic, int32_tnewval)"
  115. -
  116. +.SS "void \fBqb_atomic_int_set\fP (volatile int32_t \fBQB_GNUC_MAY_ALIAS\fP *atomic, int32_tnewval)"
  117. .PP
  118. Sets the value of the integer pointed to by atomic\&. Also acts as a memory barrier\&.
  119. .PP
  120. @@ -229,8 +217,7 @@ Sets the value of the integer pointed to
  121. .RE
  122. .PP
  123. -.SS "int32_t qb_atomic_pointer_compare_and_exchange (volatile void *\fBQB_GNUC_MAY_ALIAS\fP *atomic, void *oldval, void *newval)"
  124. -
  125. +.SS "int32_t \fBqb_atomic_pointer_compare_and_exchange\fP (volatile void *\fBQB_GNUC_MAY_ALIAS\fP *atomic, void *oldval, void *newval)"
  126. .PP
  127. Compares oldval with the pointer pointed to by atomic and if they are equal, atomically exchanges *atomic with newval\&. Also acts as a memory barrier\&.
  128. .PP
  129. @@ -249,8 +236,7 @@ QB_TRUE if atomic was equal oldval, else
  130. .RE
  131. .PP
  132. -.SS "void* qb_atomic_pointer_get (volatile void *\fBQB_GNUC_MAY_ALIAS\fP *atomic)"
  133. -
  134. +.SS "void* \fBqb_atomic_pointer_get\fP (volatile void *\fBQB_GNUC_MAY_ALIAS\fP *atomic)"
  135. .PP
  136. Reads the value of the pointer pointed to by atomic\&. Also acts as a memory barrier\&.
  137. .PP
  138. @@ -265,8 +251,7 @@ the value to add to atomic\&.
  139. .RE
  140. .PP
  141. -.SS "void qb_atomic_pointer_set (volatile void *\fBQB_GNUC_MAY_ALIAS\fP *atomic, void *newval)"
  142. -
  143. +.SS "void \fBqb_atomic_pointer_set\fP (volatile void *\fBQB_GNUC_MAY_ALIAS\fP *atomic, void *newval)"
  144. .PP
  145. Sets the value of the pointer pointed to by atomic\&. Also acts as a memory barrier\&.
  146. .PP