1. when a handler creates an instance, it is associated with a logoff object, which is a member of its corresponding thread variable copy-threadlocal variable. When it sendmessage, the message. set the handler object of the taget and add it to the messagequeue Of The logoff, waiting for the message loop.
2. logoff manages a messagequeue. logoff is called in the run () method of the thread. loop (), cyclically fetch the message from messagequeue, so that the thread becomes a logoff thread. Message is called every time the message is retrieved. taget. dispathmessage (MSG) indirectly calls handler. handlmessage () method.
3. the message uses the set bundle object, and then the handler instance sendmessage () in a thread adds the message to the messagequeue in the corresponding thread of the logoff for event loop, in this way, Inter-thread data communication is realized.