Hello,
Sometimes, I see an idiom for game exiting routines that involves a call like this:
* sceKernelExitDeleteThread(0)
In order to understand this, I wrote a program that not only initializes a main thread, but also another thread to run a simple socket server. I have found that the call above appears to terminate the main program thread; if another thread is running, it continues to run.
Question: is the appropriate way to close a multi-threaded program to do something like the following:
/* Exit callback */
int exit_callback(int arg1, int arg2, void *common)
{
/* exit some other thread I've created */
sceKernelExitDeleteThread(_thid);
/* exit main thread */
sceKernelExitDeleteThread(0);
sceKernelExitGame();
return 0;
}
? If not, can someone explain this -- I've looked through the sdk samples to no avail -- not much is there regarding PSP threading.
Thank you in advance,
~0
Noobish Question: sceKernelExitDeleteThread(int)
-
- Posts: 5
- Joined: Mon Sep 11, 2006 11:56 am
- Location: Worcester, MA
- Contact:
-
- Posts: 5
- Joined: Mon Sep 11, 2006 11:56 am
- Location: Worcester, MA
- Contact:
The functions are generally well documented in the headers...
http://svn.pspdev.org/filedetails.php?r ... rev=0&sc=1
Code: Select all
/**
* Exit a thread and delete itself.
*
* @param status - Exit status
*/
int sceKernelExitDeleteThread(int status);