| View previous topic :: View next topic |
| Author |
Message |
ZeroAltitude
Joined: 11 Sep 2006 Posts: 5 Location: Worcester, MA
|
Posted: Mon Sep 18, 2006 11:43 am Post subject: Noobish Question: sceKernelExitDeleteThread(int) |
|
|
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 |
|
| Back to top |
|
 |
ZeroAltitude
Joined: 11 Sep 2006 Posts: 5 Location: Worcester, MA
|
Posted: Mon Sep 18, 2006 11:59 am Post subject: |
|
|
Nevermind, I think I got it. The argument is the status. This function deletes a thread in a particular thread context ('self'). Another call will delete the thread from outside of the running thread context.
~0 |
|
| Back to top |
|
 |
adrahil
Joined: 16 Mar 2006 Posts: 277
|
|
| Back to top |
|
 |
|