added lock for static variables in userprocess and userkernel