Post: [SPRX/C++] Creating and Destroying Threads
11-10-2015, 09:44 AM #1
Winter
Purple God
(adsbygoogle = window.adsbygoogle || []).push({}); Just incase anyone wanted to remove their threads from the game to allow another module to be loaded (which becomes a problem after a while :p).
I know my threads (pun) are a little bare, but they get to the point quickly.

You must login or register to view this content.
it contains no binaries

once you make the same setup as this, you can stop the module or just do this
    
destroy_thread(thread_id, &loop_cancel_bool);


and it's as simple as that Winky Winky

-Just as a little side note, people who are using Hooks will have to use HookFunctionStart to restore the stub so if the PRX is stopped it'll restore it and there wont be a problem. :p
Last edited by Winter ; 11-13-2015 at 08:43 AM. Reason: Updated

The following 5 users say thank you to Winter for this useful post:

Helping-Hand, Joren, Krypton, Krrish Lobbyman, Specter
11-10-2015, 02:35 PM #2
Originally posted by Winter View Post
Just incase anyone wanted to remove their threads from the game to allow another module to be loaded (which becomes a problem after a while :p).
I know my threads (pun) are a little bare, but they get to the point quickly.

You must login or register to view this content.
it contains no binaries

once you make the same setup as this, you can stop the module or just do this
    
destroy_thread(thread_id, &loop_cancel_bool);


and it's as simple as that Winky Winky


I'm on mobile, is that download link open source? If no then I suggest you post the source so people can learn how your code works. If I was you, just make a class with a handle stack frame, along with a bitflag to identify the threads pushed (you can also have a thread constantly running to check the flag state, if you clear a flag the thread gets deleted, set a flag the thread gets created) you could also reverse the math used to generate bitflags to access an array of strings labelling each flag (if you really wanted to pin-point each thread)
11-10-2015, 09:42 PM #3
Winter
Purple God
Originally posted by Bitwise View Post
I'm on mobile, is that download link open source? If no then I suggest you post the source so people can learn how your code works. If I was you, just make a class with a handle stack frame, along with a bitflag to identify the threads pushed (you can also have a thread constantly running to check the flag state, if you clear a flag the thread gets deleted, set a flag the thread gets created) you could also reverse the math used to generate bitflags to access an array of strings labelling each flag (if you really wanted to pin-point each thread)


I'm working a on a project and in less complicated terms I'm doing that.
- also yes it is a source.
11-11-2015, 01:23 AM #4
Specter
Pro Memer
Originally posted by Winter View Post
Just incase anyone wanted to remove their threads from the game to allow another module to be loaded (which becomes a problem after a while :p).
I know my threads (pun) are a little bare, but they get to the point quickly.

You must login or register to view this content.
it contains no binaries

once you make the same setup as this, you can stop the module or just do this
    
destroy_thread(thread_id, &loop_cancel_bool);


and it's as simple as that Winky Winky

-Just as a little side note, people who are using Hooks will have to use HookFunctionStart to restore the stub so if the PRX is stopped it'll restore it and there wont be a problem. :p


Wow good tutorial man, I actually didn't know this could be done tbqh :p

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo