1. A method of protecting a shared resource in a computing system, comprising: storing, in shared memory accessible to at least a first thread and a second thread which execute concurrently in the computing system, a lock data structure for serializing access to the shared resource, the first thread executing under control of a first operating system hosted by the computing system and the second thread executing under control of a second operating system hosted by the computing system; and upon detecting, by the first thread, that a lock provided by the lock data structure is already held by the second thread, performing, by the first thread: using a socket to block while waiting for the lock to be released; adding a waiter entry to a queue, the waiter entry specifying an address of the socket on which the first thread is blocking; and receiving a notification from the second thread, on the socket, when the second thread releases the lock.