 |
forums.ps2dev.org Homebrew PS2, PSP & PS3 Development Discussions
|
| View previous topic :: View next topic |
| Author |
Message |
Derek8588
Joined: 22 Oct 2004 Posts: 62
|
Posted: Sat Sep 20, 2008 12:19 am Post subject: Help: Suspend Main and Wakeup another Thread |
|
|
I have created a simple app that sets up a vblank handler and creates a thread. What I am trying to do is when a certain condition is met within the vblank handler, it calls iSuspendThread() on my main thread and then calls iWakeupThread on the thread I created. Mains priority = 64 and my threads priority = 4. And once the Thread finished it will call ResumeThread on main. In other words, I am trying to halt main, execute a thread, and return to main without having to manually call SleepThread() within main.
For test purposes, if I manually call SleepThread() within main and then have my vblank handler call iWakeupThread() on my thread, my thread runs fine no problems. But if I dont manually call SleepThread within main, and in my handler call iSuspendThread() on main and then iWakeupThread on my thread, my thread doesnt run... Why is this, I dont understand why it's not working. Any suggestions? Thanks
Edit: one more question. How can I put a thread in WAIT state other then calling StartThread(); on it. StartThread actually runs the thread immediately. I just want it to sit in wait state until I call iWakeupThread() on it. Thanks again for your time and patience. |
|
| Back to top |
|
 |
Lukasz

Joined: 19 Jan 2004 Posts: 248 Location: Denmark
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|