diff options
author | Melanie | 2011-04-21 16:51:39 +0100 |
---|---|---|
committer | Melanie | 2011-04-21 16:51:39 +0100 |
commit | 204b8b7b7e5d879a25b576fb6bca2a189b457ed0 (patch) | |
tree | e2a6ab15ec17957dd16320c07e530d1d527410be /OpenSim/Framework/Util.cs | |
parent | Merge branch 'master' into careminster-presence-refactor (diff) | |
parent | bug fix. Now when an unacked update packet is handled through ResendPrimUpdat... (diff) | |
download | opensim-SC-204b8b7b7e5d879a25b576fb6bca2a189b457ed0.zip opensim-SC-204b8b7b7e5d879a25b576fb6bca2a189b457ed0.tar.gz opensim-SC-204b8b7b7e5d879a25b576fb6bca2a189b457ed0.tar.bz2 opensim-SC-204b8b7b7e5d879a25b576fb6bca2a189b457ed0.tar.xz |
Merge branch 'queuetest' into careminster-presence-refactor
Diffstat (limited to 'OpenSim/Framework/Util.cs')
-rw-r--r-- | OpenSim/Framework/Util.cs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index 3f676f9..366a38f 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs | |||
@@ -1549,6 +1549,23 @@ namespace OpenSim.Framework | |||
1549 | return (diff >= 0) ? diff : (diff + EnvironmentTickCountMask + 1); | 1549 | return (diff >= 0) ? diff : (diff + EnvironmentTickCountMask + 1); |
1550 | } | 1550 | } |
1551 | 1551 | ||
1552 | // Returns value of Tick Count A - TickCount B accounting for wrapping of TickCount | ||
1553 | // Assumes both tcA and tcB came from previous calls to Util.EnvironmentTickCount(). | ||
1554 | // A positive return value indicates A occured later than B | ||
1555 | public static Int32 EnvironmentTickCountCompare(Int32 tcA, Int32 tcB) | ||
1556 | { | ||
1557 | // A, B and TC are all between 0 and 0x3fffffff | ||
1558 | int tc = EnvironmentTickCount(); | ||
1559 | |||
1560 | if (tc - tcA >= 0) | ||
1561 | tcA += EnvironmentTickCountMask + 1; | ||
1562 | |||
1563 | if (tc - tcB >= 0) | ||
1564 | tcB += EnvironmentTickCountMask + 1; | ||
1565 | |||
1566 | return tcA - tcB; | ||
1567 | } | ||
1568 | |||
1552 | /// <summary> | 1569 | /// <summary> |
1553 | /// Prints the call stack at any given point. Useful for debugging. | 1570 | /// Prints the call stack at any given point. Useful for debugging. |
1554 | /// </summary> | 1571 | /// </summary> |