private void dispose0() { // check shared counter optimistically boolean isNotShared = shareCount.get() == 0; if (!isNotShared) { // try pessimistic check using CAS loop isNotShared = (shareCount.getAndDecrement() == 0); if (isNotShared) { // if the former check is true - the shared counter is negative, // so we have to reset it shareCount.set(0); } } if (isNotShared) { // we can now safely return source back to the queue source.returnToPool(); } }
private void dispose0() { // check shared counter optimistically boolean isNotShared = shareCount.get() == 0; if (!isNotShared) { // try pessimistic check using CAS loop isNotShared = (shareCount.getAndDecrement() == 0); if (isNotShared) { // if the former check is true - the shared counter is negative, // so we have to reset it shareCount.set(0); } } if (isNotShared) { // we can now safely return source back to the queue source.returnToPool(); } }
private void dispose0() { // check shared counter optimistically boolean isNotShared = shareCount.get() == 0; if (!isNotShared) { // try pessimistic check using CAS loop isNotShared = (shareCount.getAndDecrement() == 0); if (isNotShared) { // if the former check is true - the shared counter is negative, // so we have to reset it shareCount.set(0); } } if (isNotShared) { // we can now safely return source back to the queue source.returnToPool(); } }
private void dispose0() { // check shared counter optimistically boolean isNotShared = shareCount.get() == 0; if (!isNotShared) { // try pessimistic check using CAS loop isNotShared = (shareCount.getAndDecrement() == 0); if (isNotShared) { // if the former check is true - the shared counter is negative, // so we have to reset it shareCount.set(0); } } if (isNotShared) { // we can now safely return source back to the queue source.returnToPool(); } }
private void dispose0() { // check shared counter optimistically boolean isNotShared = shareCount.get() == 0; if (!isNotShared) { // try pessimistic check using CAS loop isNotShared = (shareCount.getAndDecrement() == 0); if (isNotShared) { // if the former check is true - the shared counter is negative, // so we have to reset it shareCount.set(0); } } if (isNotShared) { // we can now safely return source back to the queue source.returnToPool(); } }
private void dispose0() { // check shared counter optimistically boolean isNotShared = shareCount.get() == 0; if (!isNotShared) { // try pessimistic check using CAS loop isNotShared = (shareCount.getAndDecrement() == 0); if (isNotShared) { // if the former check is true - the shared counter is negative, // so we have to reset it shareCount.set(0); } } if (isNotShared) { // we can now safely return source back to the queue source.returnToPool(); } }
private void dispose0() { // check shared counter optimistically boolean isNotShared = shareCount.get() == 0; if (!isNotShared) { // try pessimistic check using CAS loop isNotShared = (shareCount.getAndDecrement() == 0); if (isNotShared) { // if the former check is true - the shared counter is negative, // so we have to reset it shareCount.set(0); } } if (isNotShared) { // we can now safely return source back to the queue source.returnToPool(); } }
private void dispose0() { // check shared counter optimistically boolean isNotShared = shareCount.get() == 0; if (!isNotShared) { // try pessimistic check using CAS loop isNotShared = (shareCount.getAndDecrement() == 0); if (isNotShared) { // if the former check is true - the shared counter is negative, // so we have to reset it shareCount.set(0); } } if (isNotShared) { // we can now safely return source back to the queue source.returnToPool(); } }
private void dispose0() { // check shared counter optimistically boolean isNotShared = shareCount.get() == 0; if (!isNotShared) { // try pessimistic check using CAS loop isNotShared = (shareCount.getAndDecrement() == 0); if (isNotShared) { // if the former check is true - the shared counter is negative, // so we have to reset it shareCount.set(0); } } if (isNotShared) { // we can now safely return source back to the queue source.returnToPool(); } }
private void dispose0() { // check shared counter optimistically boolean isNotShared = shareCount.get() == 0; if (!isNotShared) { // try pessimistic check using CAS loop isNotShared = (shareCount.getAndDecrement() == 0); if (isNotShared) { // if the former check is true - the shared counter is negative, // so we have to reset it shareCount.set(0); } } if (isNotShared) { // we can now safely return source back to the queue source.returnToPool(); } }
private void dispose0() { // check shared counter optimistically boolean isNotShared = shareCount.get() == 0; if (!isNotShared) { // try pessimistic check using CAS loop isNotShared = (shareCount.getAndDecrement() == 0); if (isNotShared) { // if the former check is true - the shared counter is negative, // so we have to reset it shareCount.set(0); } } if (isNotShared) { // we can now safely return source back to the queue source.returnToPool(); } }
private void dispose0() { // check shared counter optimistically boolean isNotShared = shareCount.get() == 0; if (!isNotShared) { // try pessimistic check using CAS loop isNotShared = (shareCount.getAndDecrement() == 0); if (isNotShared) { // if the former check is true - the shared counter is negative, // so we have to reset it shareCount.set(0); } } if (isNotShared) { // we can now safely return source back to the queue source.returnToPool(); } }