|
From: darcagn <da...@us...> - 2024-06-05 18:45:46
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "A pseudo Operating System for the Dreamcast.".
The branch, master has been updated
via 58f0f53e14c8df0c025385c49dd02ef63bd9bba6 (commit)
from 52e760a535aa7cf17ae5b417cc938d3e55850bdd (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 58f0f53e14c8df0c025385c49dd02ef63bd9bba6
Author: Falco Girgis <gyr...@gm...>
Date: Wed Jun 5 13:45:20 2024 -0500
Fixed false failure in once_test on 16MB RAM. (#605)
- Accidentally allocated too many goddamn threads only testing on 32MB
units
- Somehow allocation was failing gracefully on 16MB, the program never
crashed, and it just returned a real failure code...
- Running out of memory allocating a thread then trying to join on a
NULL later is apparently pristinely protected against. Impressive.
- Modified test to allocate 475 threads on 16MB and 950 on 32MB.
- Fixed the error code assignment when failing to join the thread, as it
was printing "1" rather than "-1."
-----------------------------------------------------------------------
Summary of changes:
examples/dreamcast/basic/threading/once/once_test.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/examples/dreamcast/basic/threading/once/once_test.c b/examples/dreamcast/basic/threading/once/once_test.c
index 451e550f..c3c835c4 100644
--- a/examples/dreamcast/basic/threading/once/once_test.c
+++ b/examples/dreamcast/basic/threading/once/once_test.c
@@ -23,7 +23,7 @@
#include <dc/maple/controller.h>
#define UNUSED __attribute__((unused))
-#define THD_COUNT 600
+#define THD_COUNT (475 * (DBL_MEM? 2 : 1))
static kthread_once_t once = KTHREAD_ONCE_INIT;
static spinlock_t lock = SPINLOCK_INITIALIZER;
@@ -64,7 +64,7 @@ static void *thd_func(void *param UNUSED) {
return NULL;
}
-KOS_INIT_FLAGS(INIT_DEFAULT);
+KOS_INIT_FLAGS(INIT_DEFAULT | INIT_MALLOCSTATS);
int main(int argc, char *argv[]) {
int i, retval, success = 1;
@@ -91,7 +91,7 @@ int main(int argc, char *argv[]) {
printf("Waiting for the threads to finish\n");
for(i = 0; i < THD_COUNT; ++i) {
- if((retval = thd_join(thds[i], NULL) < 0)) {
+ if((retval = thd_join(thds[i], NULL)) < 0) {
fprintf(stderr, "Failed to join thread[%d]: %d\n",
i, retval);
success = 0;
hooks/post-receive
--
A pseudo Operating System for the Dreamcast.
|