Doesn't even have to be locking, just closing. The general convention at our house is that closed door means "send me a text message or ask the other parent", open door means, "sure, come say hi".
It's been a day or two since I've had a closing door at a co-located office, so I'm not used to being able to implement such a policy in that kind of work environment.
(I'd also add that there's no quicker way to recharge your batteries than to pop out of the office to spend 10 minutes building a block tower or whatever with your kids. 14/10 much more effective than bitching about work with your colleagues in the office kitchenette.)