Back to project page BluetoothSppPro.
The source code is released under:
Apache License
If you think the Android project BluetoothSppPro listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package mobi.dzs.android.bluetooth; /* ww w .j av a 2 s . com*/ /** * PV??????????????? * @version 1.0 2014-04-24 * @author JerryLi (lijian@dzs.mobi) */ final public class CResourcePV { private int iCount=0; /** * ?? * @param iResourceCount int ??????? */ public CResourcePV(int iResourceCount){ this.iCount = iResourceCount; } /** * ??????????? * @return boolean */ public boolean isExist(){ synchronized(this){ return iCount == 0; } } /** * ?????????? * @return */ public boolean seizeRes(){ synchronized(this){ if (this.iCount > 0){ iCount--; return true; }else return false; } } /** * ???????? * @return */ public void revert(){ synchronized(this){ iCount++; } } }