Hi, Thank you for kind response. Your code worked well. While my use case requires simple binary semaphores at present, this version looks like the right way to do. Regards, Kentaro SATO