这样会死锁,请解释原因。并使其不会死锁。(已经解决问题, 散分) (300分)

  • 主题发起人 主题发起人 wlmmlw
  • 开始时间 开始时间
//找着了。大侠们也不明说,硬是要考考我,害得我查得好辛苦。
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.
 
后退
顶部