I am still working on updating JFFS2 with the write buffer support to eCos. Currently I am struggeling with workqueues. I tried to circumvent those by directly triggering the wbuf_flush() operation, but with all those semaphores I get deadlocks all the time. So to be cleaner I'd like to replicate the workqueue mechanism in eCos.
How can this be achieved? My idea is to use a whole thread for that. It may be an overkill on ressources but I think I can make it work. How would you implement synchronization, function calls?
The workqueue thread ask if new scheduled work exists, if not -> sleep for some time, after that do this process again