source: CIVL/include/headers/threads.h@ 1aaefd4

main test-branch
Last change on this file since 1aaefd4 was ea777aa, checked in by Alex Wilton <awilton@…>, 3 years ago

Moved examples, include, build_default.properties, common.xml, and README out from dev.civl.com into the root of the repo.

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@5704 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100644
File size: 1.5 KB
RevLine 
[aad342c]1/* threads.h: The ABC representation of standard C library.
2 * Based on C11 Standard.
3 */
4#ifndef _THREADS_
5#define _THREADS_
6
7#include <time.h>
8
9/* Macros */
10#define thread_local _Thread_local
11#define ONCE_FLAG_INIT 0
12#define TSS_DTOR_ITERATIONS 1
13
14/* Types */
15typedef struct cnd_t cnd_t;
16typedef struct thrd_t thrd_t;
17typedef struct tss_t tss_t;
18typedef struct mtx_t mtx_t;
19typedef void (*tss_dtor_t)(void*);
20typedef int (*thrd_start_t)(int);
21typedef struct once_flag once_flag;
22
23
24/* Functions */
25void call_once(once_flag *flag, void (*func)(void));
26int cnd_broadcast(cnd_t *cond);
27void cnd_destroy(cnd_t *cond);
28int cnd_init(cnd_t *cond);
29int cnd_signal(cnd_t *cond);
30int cnd_timedwait(cnd_t *restrict cond,mtx_t *restrict mtx,
31 const struct timespec *restrict ts);
32int cnd_wait(cnd_t *cond, mtx_t *mtx);
33void mtx_destroy(mtx_t *mtx);
34int mtx_init(mtx_t *mtx, int type);
35int mtx_lock(mtx_t *mtx);
36int mtx_timedlock(mtx_t *restrict mtx, const struct timespec *restrict ts);
37int mtx_trylock(mtx_t *mtx);
38int mtx_unlock(mtx_t *mtx);
39int thrd_create(thrd_t *thr, thrd_start_t func,void *arg);
40thrd_t thrd_current(void);
41int thrd_detach(thrd_t thr);
42int thrd_equal(thrd_t thr0, thrd_t thr1);
43_Noreturn void thrd_exit(int res);
44int thrd_join(thrd_t thr, int *res);
45int thrd_sleep(const struct timespec *duration,struct timespec *remaining);
46void thrd_yield(void);
47int tss_create(tss_t *key, tss_dtor_t dtor);
48void tss_delete(tss_t key);
49void *tss_get(tss_t key);
50int tss_set(tss_t key, void *val);
51
52#endif
Note: See TracBrowser for help on using the repository browser.