Author: remi
Date: 2008-12-17 23:26:27 +0100 (Wed, 17 Dec 2008)
New Revision: 3152
Added:
software_suite_v2/tuxware/java-api/trunk/src/com/tuxisalive/api/SLockedStack.java
Log:
* added a class to counting the pending synchronized calls to a function which
haves asynchronous conditions.
Added:
software_suite_v2/tuxware/java-api/trunk/src/com/tuxisalive/api/SLockedStack.java
===================================================================
---
software_suite_v2/tuxware/java-api/trunk/src/com/tuxisalive/api/SLockedStack.java
(rev 0)
+++
software_suite_v2/tuxware/java-api/trunk/src/com/tuxisalive/api/SLockedStack.java
2008-12-17 22:26:27 UTC (rev 3152)
@@ -0,0 +1,40 @@
+package com.tuxisalive.api;
+
+public class SLockedStack
+{
+ public SLock mutexPre;
+ public SLock mutexIn;
+
+ private SLock stackCounterMutex;
+ private Integer stackCounter = 0;
+
+ public SLockedStack()
+ {
+ stackCounterMutex = new SLock();
+ mutexPre = new SLock();
+ mutexIn = new SLock();
+ }
+
+ public void incStackCounter()
+ {
+ stackCounterMutex.acquire();
+ stackCounter++;
+ stackCounterMutex.release();
+ }
+
+ public void decStackCounter()
+ {
+ stackCounterMutex.acquire();
+ stackCounter--;
+ stackCounterMutex.release();
+ }
+
+ public Integer getStackCounter()
+ {
+ stackCounterMutex.acquire();
+ Integer result = stackCounter;
+ stackCounterMutex.release();
+ return result;
+ }
+
+}
Property changes on:
software_suite_v2/tuxware/java-api/trunk/src/com/tuxisalive/api/SLockedStack.java
___________________________________________________________________
Name: svn:keywords
+ Id
------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you. Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
Tux-droid-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tux-droid-svn