According to the comment preceding tsleep_interlock() in kern_synch.c: /* * This is a dandy function that allows us to interlock tsleep/wakeup * operations with unspecified upper level locks, such as lockmgr locks, * simply by holding a critical section. The sequence is: * * (enter critical section) * (acquire upper level lock) * tsleep_interlock(blah) * (release upper level lock) * tsleep(blah, ...) * (exit critical section)
It is not obvious to me why the first two operations can't be reversed (i.e. first acquire lock, then enter critical section). Can they? TIA, Aggelos
