From b341a986bb06a5e07982dd1e845dc94188e8c28f Mon Sep 17 00:00:00 2001 From: "fabio.olimpieri" Date: Sun, 21 Dec 2014 17:49:18 +0000 Subject: [PATCH] Thread creation error handling (max 12 treads can be created) and priority equal to the main (64) --- SDL/src/thread/wii/SDL_systhread.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/SDL/src/thread/wii/SDL_systhread.c b/SDL/src/thread/wii/SDL_systhread.c index 42bdc5e..e720e91 100644 --- a/SDL/src/thread/wii/SDL_systhread.c +++ b/SDL/src/thread/wii/SDL_systhread.c @@ -48,7 +48,12 @@ void *run_thread(void *data) int SDL_SYS_CreateThread(SDL_Thread *thread, void *args) { - LWP_CreateThread(&thread->handle, run_thread, args, 0, 0, 80); + + if ( LWP_CreateThread(&thread->handle, run_thread, args, 0, 0, 64) != 0 ) { + SDL_SetError("Not enough resources to create thread"); + return(-1); + } + return (0); }