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

  • Thread starter Thread starter NexoCube
  • Start date Start date
  • Views Views 1,169
  • Replies Replies 4
  • Likes Likes 1
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
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