Is there some way I could do this that is portable across platforms? It would be nice to verify that the locking works on windows too.