Semaphore sema = new Semaphore(1);
Create a Semaphore object and the default initialization, the only one license, when multiple threads at the same time trying to get the license, must change is only one thread can access permission, then other threads will wait outside, when the first thread to release license, then wait for the thread has the right to obtain the license or is it just the first to arrive and wait for the thread shall be entitled to Who can help me, I will appreciate it very much