Homebrew [Useless] HBL .elf - Having fun with threads

Cyan

GBATemp's lurking knight
Former Staff
Joined
Oct 27, 2002
Messages
23,749
Trophies
4
Age
46
Location
Engine room, learning
XP
15,662
Country
France
You can only exit a thread in the thread itself? ((void (*)())0x01041D6C)(); // OSExitThread()

I see you run each thread only once, then exit the program.
if your program loops (GUI interface, or game), can you run a thread and control it from the main() or another thread?
maybe the CPU needs to terminate itself, so I suppose you use pointers to check if a thread has to terminate itself and control its state from another thread (a sync thread function).


Thanks for sharing, it was easy to understand.
 
  • Like
Reactions: NexoCube

NexoCube

Well-Known Member
OP
Member
Joined
Nov 3, 2015
Messages
1,222
Trophies
0
Age
29
Location
France
XP
1,340
Country
France
You can only exit a thread in the thread itself? ((void (*)())0x01041D6C)(); // OSExitThread()

I see you run each thread only once, then exit the program.
if your program loops (GUI interface, or game), can you run a thread and control it from the main() or another thread?
maybe the CPU needs to terminate itself, so I suppose you use pointers to check if a thread has to terminate itself and control its state from another thread (a sync thread function).


Thanks for sharing, it was easy to understand.

According to the *legally owned* Cafe SDK Documentation, OSExitThread will terminate the caller thread. (I need to check again, maybe)

And thanks !
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Psionic Roshambo @ Psionic Roshambo: It's a kid's vitamin now!