W
wlmmlw
Unregistered / Unconfirmed
GUEST, unregistred user!
//找着了。大侠们也不明说,硬是要考考我,害得我查得好辛苦。
Since the interface pointer which was obtained by marshaling process actually belongs to an object created in another thread and the object cannot handle multiple threads, the SimpleMethod function in the object should be called from the same thread that created the object.
All that thread FFF81C03 needs is to SendMessage to the hidden window. As the window messages are delivered in the respective threads this method would change the execution context to thread FFFD8147. But we have not implemented any message loop in FFFD8147 and instead we are waiting for the other thread to complete execution. Thus there is a deadlock.
Since the interface pointer which was obtained by marshaling process actually belongs to an object created in another thread and the object cannot handle multiple threads, the SimpleMethod function in the object should be called from the same thread that created the object.
All that thread FFF81C03 needs is to SendMessage to the hidden window. As the window messages are delivered in the respective threads this method would change the execution context to thread FFFD8147. But we have not implemented any message loop in FFFD8147 and instead we are waiting for the other thread to complete execution. Thus there is a deadlock.