added helper methods in kernel/netlock.c