source:
mainline/uspace/lib/c/include/fibril.h@
cd1e3fc0
| Last change on this file since cd1e3fc0 was d7f7a4a, checked in by , 3 years ago | |
|---|---|
|
|
| File size: 1.1 KB | |
| Rev | Line | |
|---|---|---|
| [7e2988c] | 1 | /* |
| [d7f7a4a] | 2 | * SPDX-FileCopyrightText: 2006 Ondrej Palkovsky |
| [7e2988c] | 3 | * |
| [d7f7a4a] | 4 | * SPDX-License-Identifier: BSD-3-Clause |
| [7e2988c] | 5 | */ |
| 6 | ||
| [fadd381] | 7 | /** @addtogroup libc |
| [b2951e2] | 8 | * @{ |
| 9 | */ | |
| 10 | /** @file | |
| 11 | */ | |
| 12 | ||
| [4805495] | 13 | #ifndef _LIBC_FIBRIL_H_ |
| 14 | #define _LIBC_FIBRIL_H_ | |
| [7e2988c] | 15 | |
| [5f97ef44] | 16 | #include <time.h> |
| [bc56f30] | 17 | #include <_bits/errno.h> |
| [514d561] | 18 | #include <_bits/__noreturn.h> |
| [bc56f30] | 19 | #include <_bits/decls.h> |
| 20 | ||
| 21 | __HELENOS_DECLS_BEGIN; | |
| [7e2988c] | 22 | |
| [d73d992] | 23 | typedef struct fibril fibril_t; |
| [7f122e3] | 24 | |
| 25 | typedef struct { | |
| [d73d992] | 26 | fibril_t *owned_by; |
| [7f122e3] | 27 | } fibril_owner_info_t; |
| 28 | ||
| [514d561] | 29 | typedef fibril_t *fid_t; |
| 30 | ||
| [d8cb48d] | 31 | #ifndef __cplusplus |
| [26360f7] | 32 | /** Fibril-local variable specifier */ |
| 33 | #define fibril_local __thread | |
| [d8cb48d] | 34 | #endif |
| [eceff5f] | 35 | |
| [514d561] | 36 | extern fid_t fibril_create_generic(errno_t (*)(void *), void *, size_t); |
| [d8cb48d] | 37 | extern fid_t fibril_create(errno_t (*)(void *), void *); |
| [514d561] | 38 | extern void fibril_destroy(fid_t); |
| 39 | extern void fibril_add_ready(fid_t); | |
| [bc1f1c2] | 40 | extern fid_t fibril_get_id(void); |
| [d73d992] | 41 | extern void fibril_yield(void); |
| [80649a91] | 42 | |
| [bd41ac52] | 43 | extern void fibril_usleep(usec_t); |
| 44 | extern void fibril_sleep(sec_t); | |
| [5f97ef44] | 45 | |
| [c124c985] | 46 | extern void fibril_enable_multithreaded(void); |
| 47 | extern int fibril_test_spawn_runners(int); | |
| 48 | ||
| 49 | extern void fibril_detach(fid_t fid); | |
| 50 | ||
| [514d561] | 51 | extern void fibril_start(fid_t); |
| 52 | extern __noreturn void fibril_exit(long); | |
| 53 | ||
| [bc56f30] | 54 | __HELENOS_DECLS_END; |
| 55 | ||
| [7e2988c] | 56 | #endif |
| [b2951e2] | 57 | |
| [fadd381] | 58 | /** @} |
| [b2951e2] | 59 | */ |
Note:
See TracBrowser
for help on using the repository browser.
