Hi Thien,
PHAM ANH THIEN wrote:
I could not find a well sample dhcp source code on lwip-1.4.0.rc1 and
contribute folder, could you please to point me where it is?
The main problem with your code isn't finding an example but
understanding lwIP threading and how not to break it. Please read the
chapter "Threading" in the doc/rawapi.txt file from the lwIP source
directory.
Basically, lwIP is not thread-safe except for a very limited subset of
the APIs and the APIs explicitly meant for multithreading applications.
All funtions/modules not explicitly listed to be thread-safe must
neither be called from any other thread than the tcpip_thread nor from
interrupt context (ISR/DSR)! Having understood this basic requirement is
crucial to implementing ports (which is what you are doing).
I understand that this requirement is sometimes not easy to follow and
it took me some, too, to get used to it when starting lwIP, but that's
the way it is. If our current documentation of this basic requirement
isn't obvious enough, please do not hesitate to suggest documentation
improvements, everybody!
Thanks,
Simon
_______________________________________________
lwip-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/lwip-users