summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Kaivo <jkk@ung.org>2024-01-30 23:23:22 -0500
committerJakob Kaivo <jkk@ung.org>2024-01-30 23:23:22 -0500
commit9222a64f2e86db0d94b977d79c274d1d07003b0a (patch)
tree0d3952b0a30ab85c3fc112d1d10e2391c1be4256
parent2a381114dae8832b6ce9459e769533164bb6e4ec (diff)
update to 1:1 checked functions
-rw-r--r--src/threads/call_once.c4
-rw-r--r--src/threads/cnd_broadcast.c2
-rw-r--r--src/threads/cnd_destroy.c2
-rw-r--r--src/threads/cnd_init.c2
-rw-r--r--src/threads/cnd_signal.c2
-rw-r--r--src/threads/cnd_timedwait.c2
-rw-r--r--src/threads/cnd_wait.c2
-rw-r--r--src/threads/mtx_destroy.c2
-rw-r--r--src/threads/mtx_init.c2
-rw-r--r--src/threads/mtx_lock.c2
-rw-r--r--src/threads/mtx_timedlock.c2
-rw-r--r--src/threads/mtx_trylock.c2
-rw-r--r--src/threads/mtx_unlock.c2
-rw-r--r--src/threads/thrd_create.c2
-rw-r--r--src/threads/thrd_current.c2
-rw-r--r--src/threads/thrd_detach.c2
-rw-r--r--src/threads/thrd_equal.c2
-rw-r--r--src/threads/thrd_exit.c2
-rw-r--r--src/threads/thrd_join.c2
-rw-r--r--src/threads/thrd_sleep.c2
-rw-r--r--src/threads/thrd_yield.c2
-rw-r--r--src/threads/tss_create.c2
-rw-r--r--src/threads/tss_delete.c2
-rw-r--r--src/threads/tss_get.c2
-rw-r--r--src/threads/tss_set.c2
25 files changed, 52 insertions, 0 deletions
diff --git a/src/threads/call_once.c b/src/threads/call_once.c
index c09886ec..8757d200 100644
--- a/src/threads/call_once.c
+++ b/src/threads/call_once.c
@@ -9,6 +9,10 @@ void call_once(once_flag *flag, void (*func)(void))
pthread_once(flag, func);
}
+typedef void (*once_fn)(void);
+
+__vcheck_2(call_once, once_flag *, once_fn);
+
/*
STDC(201112)
*/
diff --git a/src/threads/cnd_broadcast.c b/src/threads/cnd_broadcast.c
index 58a6a199..5253c1e8 100644
--- a/src/threads/cnd_broadcast.c
+++ b/src/threads/cnd_broadcast.c
@@ -9,6 +9,8 @@ int cnd_broadcast(cnd_t *cond)
return pthread_cond_broadcast(cond) == 0 ? thrd_success : thrd_error;
}
+__check_1(int, 0, cnd_broadcast, cnd_t *)
+
/*
STDC(201112)
*/
diff --git a/src/threads/cnd_destroy.c b/src/threads/cnd_destroy.c
index 07cee092..32b0d2c6 100644
--- a/src/threads/cnd_destroy.c
+++ b/src/threads/cnd_destroy.c
@@ -9,6 +9,8 @@ void cnd_destroy(cnd_t *cond)
pthread_cond_destroy(cond);
}
+__vcheck_1(cnd_destroy, cnd_t *)
+
/*
STDC(201112)
*/
diff --git a/src/threads/cnd_init.c b/src/threads/cnd_init.c
index e44abe21..94cc142f 100644
--- a/src/threads/cnd_init.c
+++ b/src/threads/cnd_init.c
@@ -21,6 +21,8 @@ int cnd_init(cnd_t *cond)
return thrd_error;
}
+__check_1(int, 0, cnd_init, cnd_t *)
+
/*
STDC(201112)
*/
diff --git a/src/threads/cnd_signal.c b/src/threads/cnd_signal.c
index 5d22c656..bce158be 100644
--- a/src/threads/cnd_signal.c
+++ b/src/threads/cnd_signal.c
@@ -9,6 +9,8 @@ int cnd_signal(cnd_t *cond)
return pthread_cond_signal(cond) == 0 ? thrd_success : thrd_error;
}
+__check_1(int, 0, cnd_signal, cnd_t *)
+
/*
STDC(201112)
*/
diff --git a/src/threads/cnd_timedwait.c b/src/threads/cnd_timedwait.c
index 5758183e..dfa13b93 100644
--- a/src/threads/cnd_timedwait.c
+++ b/src/threads/cnd_timedwait.c
@@ -21,6 +21,8 @@ int cnd_timedwait(cnd_t *restrict cond, mtx_t *restrict mtx, const struct timesp
return thrd_error;
}
+__check_3(int, 0, cnd_timedwait, cnd_t * restrict, mtx_t * restrict, const struct timespec * restrict)
+
/*
STDC(201112)
*/
diff --git a/src/threads/cnd_wait.c b/src/threads/cnd_wait.c
index 577ffa5f..dc929573 100644
--- a/src/threads/cnd_wait.c
+++ b/src/threads/cnd_wait.c
@@ -9,6 +9,8 @@ int cnd_wait(cnd_t *cond, mtx_t *mtx)
return pthread_cond_wait(cond, mtx) == 0 ? thrd_success : thrd_error;
}
+__check_2(int, 0, cnd_wait, cnd_t *, mtx_t *)
+
/*
STDC(201112)
*/
diff --git a/src/threads/mtx_destroy.c b/src/threads/mtx_destroy.c
index 93a8e0f5..fe5f8950 100644
--- a/src/threads/mtx_destroy.c
+++ b/src/threads/mtx_destroy.c
@@ -9,6 +9,8 @@ void mtx_destroy(mtx_t *mtx)
pthread_mutex_destroy(mtx);
}
+__vcheck_1(mtx_destroy, mtx_t *)
+
/*
STDC(201112)
*/
diff --git a/src/threads/mtx_init.c b/src/threads/mtx_init.c
index 56e5196a..43691c3d 100644
--- a/src/threads/mtx_init.c
+++ b/src/threads/mtx_init.c
@@ -17,6 +17,8 @@ int mtx_init(mtx_t *mtx, int type)
return pthread_mutex_init(mtx, &attr) == 0 ? thrd_success : thrd_error;
}
+__check_2(int, 0, mtx_init, mtx_t *, int)
+
/*
STDC(201112)
*/
diff --git a/src/threads/mtx_lock.c b/src/threads/mtx_lock.c
index da97db79..85b80395 100644
--- a/src/threads/mtx_lock.c
+++ b/src/threads/mtx_lock.c
@@ -9,6 +9,8 @@ int mtx_lock(mtx_t *mtx)
return pthread_mutex_lock(mtx);
}
+__check_1(int, 0, mtx_lock, mtx_t *)
+
/*
STDC(201112)
*/
diff --git a/src/threads/mtx_timedlock.c b/src/threads/mtx_timedlock.c
index f0681abf..1b073786 100644
--- a/src/threads/mtx_timedlock.c
+++ b/src/threads/mtx_timedlock.c
@@ -21,6 +21,8 @@ int mtx_timedlock(mtx_t *restrict mtx, const struct timespec *restrict ts)
return thrd_error;
}
+__check_2(int, 0, mtx_timedlock, mtx_t * restrict, const struct timespec * restrict)
+
/*
STDC(201112)
*/
diff --git a/src/threads/mtx_trylock.c b/src/threads/mtx_trylock.c
index 2188c934..0dd169fa 100644
--- a/src/threads/mtx_trylock.c
+++ b/src/threads/mtx_trylock.c
@@ -21,6 +21,8 @@ int mtx_trylock(mtx_t *mtx)
return thrd_error;
}
+__check_1(int, 0, mtx_trylock, mtx_t *)
+
/*
STDC(201112)
*/
diff --git a/src/threads/mtx_unlock.c b/src/threads/mtx_unlock.c
index 0b2b5fec..fe789420 100644
--- a/src/threads/mtx_unlock.c
+++ b/src/threads/mtx_unlock.c
@@ -9,6 +9,8 @@ int mtx_unlock(mtx_t *mtx)
return pthread_mutex_unlock(mtx) == 0 ? thrd_success : thrd_error;
}
+__check_1(int, 0, mtx_unlock, mtx_t *)
+
/*
STDC(201112)
*/
diff --git a/src/threads/thrd_create.c b/src/threads/thrd_create.c
index e09bf682..0b64b0c6 100644
--- a/src/threads/thrd_create.c
+++ b/src/threads/thrd_create.c
@@ -22,6 +22,8 @@ int thrd_create(thrd_t *thr, thrd_start_t func, void *arg)
return thrd_error;
}
+__check_3(int, 0, thrd_create, thrd_t *, thrd_start_t, void *)
+
/*
STDC(201112)
*/
diff --git a/src/threads/thrd_current.c b/src/threads/thrd_current.c
index 7562a95a..f18d7b29 100644
--- a/src/threads/thrd_current.c
+++ b/src/threads/thrd_current.c
@@ -9,6 +9,8 @@ thrd_t thrd_current(void)
return pthread_self();
}
+__check_0(thrd_t, 0, thrd_current)
+
/*
STDC(201112)
*/
diff --git a/src/threads/thrd_detach.c b/src/threads/thrd_detach.c
index 03ccb774..1840abee 100644
--- a/src/threads/thrd_detach.c
+++ b/src/threads/thrd_detach.c
@@ -9,6 +9,8 @@ int thrd_detach(thrd_t thr)
return pthread_detach(thr) == 0 ? thrd_success : thrd_error;
}
+__check_1(int, 0, thrd_detach, thrd_t)
+
/*
STDC(201112)
*/
diff --git a/src/threads/thrd_equal.c b/src/threads/thrd_equal.c
index cf2a64b1..7d072c2c 100644
--- a/src/threads/thrd_equal.c
+++ b/src/threads/thrd_equal.c
@@ -9,6 +9,8 @@ int thrd_equal(thrd_t thr0, thrd_t thr1)
return pthread_equal(thr0, thr1);
}
+__check_2(int, 0, thrd_equal, thrd_t, thrd_t)
+
/*
STDC(201112)
*/
diff --git a/src/threads/thrd_exit.c b/src/threads/thrd_exit.c
index 117b63c2..0ccca6a7 100644
--- a/src/threads/thrd_exit.c
+++ b/src/threads/thrd_exit.c
@@ -9,6 +9,8 @@ _Noreturn void thrd_exit(int res)
pthread_exit(&res);
}
+__vcheck_1(thrd_exit, int)
+
/*
STDC(201112)
*/
diff --git a/src/threads/thrd_join.c b/src/threads/thrd_join.c
index 24001f60..fef04302 100644
--- a/src/threads/thrd_join.c
+++ b/src/threads/thrd_join.c
@@ -9,6 +9,8 @@ int thrd_join(thrd_t thr, int *res)
return pthread_join(thr, (void**)&res) == 0 ? thrd_success : thrd_error;
}
+__check_2(int, 0, thrd_join, thrd_t, int *)
+
/*
STDC(201112)
*/
diff --git a/src/threads/thrd_sleep.c b/src/threads/thrd_sleep.c
index 7347d02c..cb8cd448 100644
--- a/src/threads/thrd_sleep.c
+++ b/src/threads/thrd_sleep.c
@@ -9,6 +9,8 @@ int thrd_sleep(const struct timespec *duration, struct timespec *remaining)
return nanosleep(duration, remaining);
}
+__check_2(int, 0, thrd_sleep, const struct timespec *, struct timespec *)
+
/*
STDC(201112)
*/
diff --git a/src/threads/thrd_yield.c b/src/threads/thrd_yield.c
index b6bc0f93..2e468558 100644
--- a/src/threads/thrd_yield.c
+++ b/src/threads/thrd_yield.c
@@ -9,6 +9,8 @@ void thrd_yield(void)
sched_yield();
}
+__vcheck_0(thrd_yield)
+
/*
STDC(201112)
*/
diff --git a/src/threads/tss_create.c b/src/threads/tss_create.c
index 71a6e68a..e5f254e1 100644
--- a/src/threads/tss_create.c
+++ b/src/threads/tss_create.c
@@ -9,6 +9,8 @@ int tss_create(tss_t *key, tss_dtor_t dtor)
return pthread_key_create(key, dtor) == 0 ? thrd_success : thrd_error;
}
+__check_2(int, 0, tss_create, tss_t *, tss_dtor_t)
+
/*
STDC(201112)
*/
diff --git a/src/threads/tss_delete.c b/src/threads/tss_delete.c
index a76c47aa..99e71ef8 100644
--- a/src/threads/tss_delete.c
+++ b/src/threads/tss_delete.c
@@ -9,6 +9,8 @@ void tss_delete(tss_t key)
pthread_key_delete(key);
}
+__vcheck_1(tss_delete, tss_t)
+
/*
STDC(201112)
*/
diff --git a/src/threads/tss_get.c b/src/threads/tss_get.c
index 03c96419..68ff5cd1 100644
--- a/src/threads/tss_get.c
+++ b/src/threads/tss_get.c
@@ -9,6 +9,8 @@ void *tss_get(tss_t key)
return pthread_getspecific(key);
}
+__check_1(void *, 0, tss_get, tss_t)
+
/*
STDC(201112)
*/
diff --git a/src/threads/tss_set.c b/src/threads/tss_set.c
index 0e0a7b3c..c6a09f2b 100644
--- a/src/threads/tss_set.c
+++ b/src/threads/tss_set.c
@@ -9,6 +9,8 @@ int tss_set(tss_t key, void *val)
return pthread_setspecific(key, val) == 0 ? thrd_success : thrd_error;
}
+__check_2(int, 0, tss_set, tss_t, void *)
+
/*
STDC(201112)
*/