Either test() or acquire() which internally calls test as first thing. To both of them I'll put in some more comments.