Re: [gsoc] use of lwkt messages

看板DFBSD_kernel作者時間14年前 (2011/06/23 20:32), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
Hi, 2011/6/23 St廧hanie Ouillon <stephanie@minet.net>: > ꂠꀠ/* lwkt_initport_thread(&sc->sc_port, *(sc->sc_td)); not declared in any > header ? */ > ꂠꀠ&sc->sc_port->mp_waitport(&sc->sc_port, 0); lwkt_initport_thread should be called from the thread you create, and passing curthread as second argument. To wait for messages you use msg = lwkt_waitport(&sc->sc_port, 0); .... do something with the message... .... and reply to it, if nothing else so it is drained... lwkt_replymsg(msg, 0); The reply port would be a port initialized with lwkt_initport_replyonly if it is to behave just as a message sink (to free up messages that are not used anymore). I suggest you have a look at sys/vfs/devfs/devfs_core.c which makes heavy use of lwkt messages and is relatively simple. It should also answer most of the other questions you have regarding lwkt messages. If you need further info after looking at that, feel free to ask anything specific. HTH, Alex Hornung
文章代碼(AID): #1E0p98mK (DFBSD_kernel)