freenode/#mezzano - IRC Chatlog
Search
17:36:49
froggey
leo_song: right, those threads are special. they get created by the cold-generator and reinitialized every boot. other threads (including driver workers) maintain their state over snapshot
17:37:54
froggey
to terminate thread nicely you can call terminate-thread on it. that'll cause it to run unwind-protect handlers & exit neatly
17:41:14
froggey
I don't really like terminate-thread, it's difficult to make threads behave properly with it 100% of the time, but it's better that just dropping the thread on the floor
17:41:46
froggey
ideally the system would send driver workers some kind of notification that the device has gone away, but I haven't really given much thought to that
22:24:04
leo_song
froggey: I clean up those driver threads at boot, at that stage, the initial-thread still holding the world, if I call (terminate-thread x), it will cause panic.
22:31:42
leo_song
One idea is that, currently, my code use a integer as the flag, and other than this integer, i can use a closure, created as a cleaning function when making the driver thread.
22:34:40
leo_song
The (terminate-driver-threads) just drop the driver threads, and call their cleaning functions
22:45:27
froggey
leo_song: run terminate-driver-threads in the the post-boot worker, use the boot-id to determine if the thread is from a prior boot?