-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
KERNEL: Correctly using ST threads, an HTTP request shorter than 10 milliseconds may cause a segmentation fault. #110
Comments
If the thread is terminated immediately after creation, interrupt can still take effect, for example:
Output:
This indicates that the thread function pfn does not need to consider the situation of being terminated before it is started.
After 1 second, the interrupt function is called. At this time, the thread has already started and entered the waiting state. The interrupt is effective and the output is as follows:
This indicates that if it is only an IO operation (without a loop), there is no need to use a state variable. It can be directly handled.
Under the influence of the variables "loop" and "interrupt", the thread exits normally, and the result is as follows:
Based on the above considerations, the lifecycle of the ST thread can be simplified: link
|
https://github.com/winlinvip/simple-rtmp-server/issues/110
TRANS_BY_GPT3
The text was updated successfully, but these errors were encountered: