Could someone point me to the right place?

Here is the pseudo code:

Mutex mx = new Mutex();

public void TurnLightsOff()
{
  if (mx.aquire(ID_1) == false)
  {
    // run some code
    mx.release();
  }
}

public void TurnLightsOn()
{
  if (mx.aquire(ID_2) == false)
  {
    // run some code
    mx.release();
  }
}

If the user calls TurnLightsOff() multiple times it will only take the
first request if ID_1 is on the queue and ignore the rest of the
aquire request since it is already in the line waiting for the
aquire...  I don't want to pile up aquires of the same request
TurnLightsOff() function...  How can I do this? I can't think of the
name for this type of mutex scenarios...

Thanks in advance..
-Moto
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to