> More likely is that the socket is prematurely freed before unp_gc > grabs it at all. But then the mutex_oncpu() in the if above the do...while would panic, no?
> You could do something like create a global variable that stores the > socket pointer that unp_gc is currently working on, shortly before it > tries solock, and kassert that soclose isn't given that. I thought about something like that but thought that was too simplistic. How do I synchronize the variable value amongst threads?