The open source OpenXR runtime
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

a/os: Improve docs in the threading header.

+41
+41
src/xrt/auxiliary/os/os_threading.h
··· 58 58 59 59 /*! 60 60 * Init. 61 + * 62 + * @public @memberof os_mutex 61 63 */ 62 64 static inline int 63 65 os_mutex_init(struct os_mutex *om) ··· 67 69 68 70 /*! 69 71 * Lock. 72 + * 73 + * @public @memberof os_mutex 70 74 */ 71 75 static inline void 72 76 os_mutex_lock(struct os_mutex *om) ··· 74 78 pthread_mutex_lock(&om->mutex); 75 79 } 76 80 81 + /*! 82 + * Try to lock, but do not block. 83 + * 84 + * @public @memberof os_mutex 85 + */ 77 86 static inline int 78 87 os_mutex_trylock(struct os_mutex *om) 79 88 { ··· 82 91 83 92 /*! 84 93 * Unlock. 94 + * 95 + * @public @memberof os_mutex 85 96 */ 86 97 static inline void 87 98 os_mutex_unlock(struct os_mutex *om) ··· 91 102 92 103 /*! 93 104 * Clean up. 105 + * 106 + * @public @memberof os_mutex 94 107 */ 95 108 static inline void 96 109 os_mutex_destroy(struct os_mutex *om) ··· 111 124 112 125 /*! 113 126 * Init. 127 + * 128 + * @public @memberof os_cond 114 129 */ 115 130 static inline int 116 131 os_cond_init(struct os_cond *oc) ··· 120 135 121 136 /*! 122 137 * Signal. 138 + * 139 + * @public @memberof os_cond 123 140 */ 124 141 static inline void 125 142 os_cond_signal(struct os_cond *oc) ··· 129 146 130 147 /*! 131 148 * Wait. 149 + * 150 + * @public @memberof os_cond 132 151 */ 133 152 static inline void 134 153 os_cond_wait(struct os_cond *oc, struct os_mutex *om) ··· 138 157 139 158 /*! 140 159 * Clean up. 160 + * 161 + * @public @memberof os_cond 141 162 */ 142 163 static inline void 143 164 os_cond_destroy(struct os_cond *oc) ··· 163 184 164 185 /*! 165 186 * Run function. 187 + * 188 + * @public @memberof os_thread 166 189 */ 167 190 typedef void *(*os_run_func)(void *); 168 191 169 192 /*! 170 193 * Init. 194 + * 195 + * @public @memberof os_thread 171 196 */ 172 197 static inline int 173 198 os_thread_init(struct os_thread *ost) ··· 177 202 178 203 /*! 179 204 * Start thread. 205 + * 206 + * @public @memberof os_thread 180 207 */ 181 208 static inline int 182 209 os_thread_start(struct os_thread *ost, os_run_func func, void *ptr) ··· 186 213 187 214 /*! 188 215 * Join. 216 + * 217 + * @public @memberof os_thread 189 218 */ 190 219 static inline void 191 220 os_thread_join(struct os_thread *ost) ··· 198 227 199 228 /*! 200 229 * Destruction. 230 + * 231 + * @public @memberof os_thread 201 232 */ 202 233 static inline void 203 234 os_thread_destroy(struct os_thread *ost) ··· 235 266 236 267 /*! 237 268 * Init. 269 + * 270 + * @public @memberof os_semaphore 238 271 */ 239 272 static inline int 240 273 os_semaphore_init(struct os_semaphore *os, int count) ··· 244 277 245 278 /*! 246 279 * Release. 280 + * 281 + * @public @memberof os_semaphore 247 282 */ 248 283 static inline void 249 284 os_semaphore_release(struct os_semaphore *os) ··· 255 290 * Set @p ts to the current time, plus the timeout_ns value. 256 291 * 257 292 * Intended for use by the threading code only: the timestamps are not interchangeable with other sources of time. 293 + * 294 + * @public @memberof os_semaphore 258 295 */ 259 296 static inline int 260 297 os_semaphore_get_realtime_clock(struct timespec *ts, uint64_t timeout_ns) ··· 280 317 281 318 /*! 282 319 * Wait, if @p timeout_ns is zero then waits forever. 320 + * 321 + * @public @memberof os_semaphore 283 322 */ 284 323 static inline void 285 324 os_semaphore_wait(struct os_semaphore *os, uint64_t timeout_ns) ··· 299 338 300 339 /*! 301 340 * Clean up. 341 + * 342 + * @public @memberof os_semaphore 302 343 */ 303 344 static inline void 304 345 os_semaphore_destroy(struct os_semaphore *os)