Package com.arjuna.ats.txoj

Examples of com.arjuna.ats.txoj.Lock


      try
      {
        atomicTransaction.begin();

        if (setlock(new Lock(LockMode.WRITE), 0) == LockResult.GRANTED)
        {
          atomicTransaction.commit(true);
        }
        else
        {
View Full Code Here


      try
      {
        atomicTransaction.begin();

        if (setlock(new Lock(LockMode.READ), 0) == LockResult.GRANTED)
        {
          atomicTransaction.rollback();
        }
        else
        {
View Full Code Here

      try
      {
        atomicTransaction.begin();

        if (setlock(new Lock(LockMode.WRITE), 0) == LockResult.GRANTED)
        {
          atomicTransaction.rollback();
        }
        else
        {
View Full Code Here

    {
      int locking_result = LockResult.REFUSED;
      int locking_attempt_count = 0;
      do
      {
        locking_result = setlock(new Lock(LockMode.WRITE), retry, wait_time);

        if (locking_result == LockResult.GRANTED)
        {
          mValue++;
        }
View Full Code Here

      int locking_result = LockResult.REFUSED;
      int locking_attempt_count = 0;

      do
      {
        locking_result = setlock(new Lock(LockMode.READ), retry, wait_time);

        if (locking_result == LockResult.GRANTED)
        {
          return_value = mValue;
        }
View Full Code Here

  public int increase(int retry, int wait_time)
  {
    int returnValue = 0;
    int locking_result = LockResult.REFUSED;
    int locking_attempt_count = 0;
    Lock lck = new Lock(LockMode.WRITE);
    do
    {
      locking_result = setlock(lck, retry, wait_time);

      if (locking_result == LockResult.GRANTED)
View Full Code Here

  public int getValue(int retry, int wait_time)
  {
    int return_value = 0;
    int locking_result = LockResult.REFUSED;
    int locking_attempt_count = 0;
    Lock lck = new Lock(LockMode.READ);

    do
    {
      locking_result = setlock(lck, retry, wait_time);
View Full Code Here

    int locking_result = LockResult.REFUSED;
    int locking_attempt_count = 0;

    do
    {
      locking_result = setlock(new Lock(LockMode.WRITE), retry, wait_time);

      if (locking_result == LockResult.GRANTED)
      {
        mValue++;
      }
View Full Code Here

    int locking_result = LockResult.REFUSED;
    int locking_attempt_count = 0;

    do
    {
      locking_result = setlock(new Lock(LockMode.READ), retry, wait_time);

      if (locking_result == LockResult.GRANTED)
      {
        return_value = mValue;
      }
View Full Code Here

  public void get(IntHolder value)
      throws InvocationException
  {
    try
    {
      if (setlock(new Lock(LockMode.READ), 0) == LockResult.GRANTED)
      {
        value.value = _value;
      }
      else
      {
View Full Code Here

TOP

Related Classes of com.arjuna.ats.txoj.Lock

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.