📄 d-timeout.txt
字号:
Handling Timeout
----------------
Situation, when ExpTime (dwMilliseconds) has expired but remote thread is active,
is called Timeout.
Timeouts are often caused by waiting of remote thread for critical section (CS).
When AH function returns with ErrorAHTimeOut and
A) RC_FL_OWNTIMEOUT or RC_FL_TERMINATE (in RCINFO) were NOT set
Thread is forgotten. It goes on execution after CS is left.
B) Both RC_FL_OWNTIMEOUT and RC_FL_TERMINATE were set
go D).
C) RC_FL_TERMINATE was set
AH suspends the remote thread, terminates it, and waits for 4 seconds for it to be signaled.
If it is signaled, AH frees ThreadStack and ThreadBody.
If it is not signaled, thread is forgotten.
This RCFlag should be used with care.
D) RC_FL_OWNTIMEOUIT was set
AH fills in the whole RCINFO.
It's up to developer to wait for thread's return and get exit code.
If developer decides to terminate thread (be careful) and termination is succesful
(thread is signaled), both ThreadBody and ThreadStack should be freed.
If the thread is signaled (has returned), developer
- should free ThreadStack, if RC_PF_NATIVE flag is set in RCINFO.ProcFlags,
- should free ThreadBody, if RC_FL_OWNFREE flag is set in RCINFO.RCFlags.
Note: If dwMilliseconds==0, remote thread is created suspended. Resume it after all
changes. See Examples\D-Timeout\ThreadControl.
See:
Examples\D-Timeout.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -