| |

VerySource

 Forgot password?
 Register
Search
View: 787|Reply: 3

What about thread destruction?

[Copy link]

1

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-2-21 07:00:03
| Show all posts |Read mode
When I Terminate a thread, it will not run the destructor.
And you cannot use Delete to destruct it.
What method do you use to terminate the thread? Because the destructor has its own code, it must be run.
That is, you cannot Delete and Terminate does not run the destructor. I don't know what method to use.
Uncle Ben is really depressed!
Either add a function and run <My Code + Terminate>, if it doesn't feel like a good way.
Hope you guys advice !! Thank you !!!!!!!!!
Reply

Use magic Report

0

Threads

6

Posts

7.00

Credits

Newbie

Rank: 1

Credits
7.00

 China

Post time: 2020-5-7 06:00:01
| Show all posts
I really wanted to laugh when I saw it. Do n’t call me uncle here. Ask questions like you should. Go back to help yourself, don't tell me that you can't read English there.
Reply

Use magic Report

0

Threads

14

Posts

10.00

Credits

Newbie

Rank: 1

Credits
10.00

 United States

Post time: 2020-5-22 09:45:02
| Show all posts
You can jump out according to the condition in the thread code
Add this-> Free () to the last line of the thread code, and the thread is automatically released.
Reply

Use magic Report

0

Threads

14

Posts

10.00

Credits

Newbie

Rank: 1

Credits
10.00

 China

Post time: 2020-5-22 11:15:01
| Show all posts
The original landlord is an uncle
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list