diff options
author | Melanie | 2009-10-07 01:44:36 +0100 |
---|---|---|
committer | Melanie | 2009-10-07 01:44:36 +0100 |
commit | 9618c196c274fefda4437eff6d25c7a12e7a3ee1 (patch) | |
tree | b860a6f957e3d0b2504ca2ec6802b1a211e4a3de /OpenSim/Region/ClientStack/LindenUDP | |
parent | Commented noisy debugging about packet splitting (diff) | |
download | opensim-SC_OLD-9618c196c274fefda4437eff6d25c7a12e7a3ee1.zip opensim-SC_OLD-9618c196c274fefda4437eff6d25c7a12e7a3ee1.tar.gz opensim-SC_OLD-9618c196c274fefda4437eff6d25c7a12e7a3ee1.tar.bz2 opensim-SC_OLD-9618c196c274fefda4437eff6d25c7a12e7a3ee1.tar.xz |
Revert "Merging in diva's locking fixes"
This reverts commit 832cc685138b2244529f10b54b373c34adb4a633.
Diffstat (limited to 'OpenSim/Region/ClientStack/LindenUDP')
-rw-r--r-- | OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 116 |
1 files changed, 47 insertions, 69 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 60dab5f..84e705a 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | |||
@@ -3546,7 +3546,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3546 | objectData.TextureAnim = textureanim; | 3546 | objectData.TextureAnim = textureanim; |
3547 | } | 3547 | } |
3548 | 3548 | ||
3549 | bool doUpdate = false; | ||
3550 | lock (m_primFullUpdates) | 3549 | lock (m_primFullUpdates) |
3551 | { | 3550 | { |
3552 | if (m_primFullUpdates.Count == 0) | 3551 | if (m_primFullUpdates.Count == 0) |
@@ -3555,10 +3554,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3555 | m_primFullUpdates.Add(objectData); | 3554 | m_primFullUpdates.Add(objectData); |
3556 | 3555 | ||
3557 | if (m_primFullUpdates.Count >= m_primFullUpdatesPerPacket) | 3556 | if (m_primFullUpdates.Count >= m_primFullUpdatesPerPacket) |
3558 | doUpdate = true; | 3557 | ProcessPrimFullUpdates(this, null); |
3559 | } | 3558 | } |
3560 | if (doUpdate) | ||
3561 | ProcessPrimFullUpdates(this, null); | ||
3562 | } | 3559 | } |
3563 | 3560 | ||
3564 | void HandleQueueEmpty(ThrottleOutPacketType queue) | 3561 | void HandleQueueEmpty(ThrottleOutPacketType queue) |
@@ -3579,40 +3576,35 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3579 | 3576 | ||
3580 | void ProcessPrimFullUpdates(object sender, ElapsedEventArgs e) | 3577 | void ProcessPrimFullUpdates(object sender, ElapsedEventArgs e) |
3581 | { | 3578 | { |
3582 | bool stopTimer = false; | ||
3583 | lock (m_primFullUpdates) | 3579 | lock (m_primFullUpdates) |
3584 | { | 3580 | { |
3585 | if (m_primFullUpdates.Count == 0 && m_primFullUpdateTimer.Enabled) | 3581 | if (m_primFullUpdates.Count == 0 && m_primFullUpdateTimer.Enabled) |
3586 | stopTimer = true; | 3582 | { |
3587 | } | 3583 | lock (m_primFullUpdateTimer) |
3588 | if (stopTimer) | 3584 | m_primFullUpdateTimer.Stop(); |
3589 | { | 3585 | |
3590 | lock (m_primFullUpdateTimer) | 3586 | return; |
3591 | m_primFullUpdateTimer.Stop(); | 3587 | } |
3592 | return; | ||
3593 | } | ||
3594 | 3588 | ||
3595 | ObjectUpdatePacket outPacket = | 3589 | ObjectUpdatePacket outPacket = |
3596 | (ObjectUpdatePacket)PacketPool.Instance.GetPacket( | 3590 | (ObjectUpdatePacket)PacketPool.Instance.GetPacket( |
3597 | PacketType.ObjectUpdate); | 3591 | PacketType.ObjectUpdate); |
3598 | 3592 | ||
3599 | outPacket.RegionData.RegionHandle = | 3593 | outPacket.RegionData.RegionHandle = |
3600 | Scene.RegionInfo.RegionHandle; | 3594 | Scene.RegionInfo.RegionHandle; |
3601 | outPacket.RegionData.TimeDilation = | 3595 | outPacket.RegionData.TimeDilation = |
3602 | (ushort)(Scene.TimeDilation * ushort.MaxValue); | 3596 | (ushort)(Scene.TimeDilation * ushort.MaxValue); |
3603 | 3597 | ||
3604 | int max = m_primFullUpdates.Count; | 3598 | int max = m_primFullUpdates.Count; |
3605 | if (max > m_primFullUpdatesPerPacket) | 3599 | if (max > m_primFullUpdatesPerPacket) |
3606 | max = m_primFullUpdatesPerPacket; | 3600 | max = m_primFullUpdatesPerPacket; |
3607 | 3601 | ||
3608 | int count = 0; | 3602 | int count = 0; |
3609 | int size = 0; | 3603 | int size = 0; |
3610 | 3604 | ||
3611 | byte[] zerobuffer = new byte[1024]; | 3605 | byte[] zerobuffer = new byte[1024]; |
3612 | byte[] blockbuffer = new byte[1024]; | 3606 | byte[] blockbuffer = new byte[1024]; |
3613 | 3607 | ||
3614 | lock (m_primFullUpdates) | ||
3615 | { | ||
3616 | for (count = 0 ; count < max ; count++) | 3608 | for (count = 0 ; count < max ; count++) |
3617 | { | 3609 | { |
3618 | int length = 0; | 3610 | int length = 0; |
@@ -3636,12 +3628,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3636 | OutPacket(outPacket, ThrottleOutPacketType.Task); | 3628 | OutPacket(outPacket, ThrottleOutPacketType.Task); |
3637 | 3629 | ||
3638 | if (m_primFullUpdates.Count == 0 && m_primFullUpdateTimer.Enabled) | 3630 | if (m_primFullUpdates.Count == 0 && m_primFullUpdateTimer.Enabled) |
3639 | stopTimer = true; | 3631 | lock (m_primFullUpdateTimer) |
3632 | m_primFullUpdateTimer.Stop(); | ||
3640 | } | 3633 | } |
3641 | |||
3642 | if (stopTimer) | ||
3643 | lock (m_primFullUpdateTimer) | ||
3644 | m_primFullUpdateTimer.Stop(); | ||
3645 | } | 3634 | } |
3646 | 3635 | ||
3647 | /// <summary> | 3636 | /// <summary> |
@@ -3660,7 +3649,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3660 | CreatePrimImprovedBlock(localID, position, rotation, | 3649 | CreatePrimImprovedBlock(localID, position, rotation, |
3661 | velocity, rotationalvelocity, state); | 3650 | velocity, rotationalvelocity, state); |
3662 | 3651 | ||
3663 | bool doUpdate = false; | ||
3664 | lock (m_primTerseUpdates) | 3652 | lock (m_primTerseUpdates) |
3665 | { | 3653 | { |
3666 | if (m_primTerseUpdates.Count == 0) | 3654 | if (m_primTerseUpdates.Count == 0) |
@@ -3669,51 +3657,43 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3669 | m_primTerseUpdates.Add(objectData); | 3657 | m_primTerseUpdates.Add(objectData); |
3670 | 3658 | ||
3671 | if (m_primTerseUpdates.Count >= m_primTerseUpdatesPerPacket) | 3659 | if (m_primTerseUpdates.Count >= m_primTerseUpdatesPerPacket) |
3672 | doUpdate = true; | 3660 | ProcessPrimTerseUpdates(this, null); |
3673 | } | 3661 | } |
3674 | if (doUpdate) | ||
3675 | ProcessPrimTerseUpdates(this, null); | ||
3676 | } | 3662 | } |
3677 | 3663 | ||
3678 | void ProcessPrimTerseUpdates(object sender, ElapsedEventArgs e) | 3664 | void ProcessPrimTerseUpdates(object sender, ElapsedEventArgs e) |
3679 | { | 3665 | { |
3680 | bool stopTimer = false; | ||
3681 | lock (m_primTerseUpdates) | 3666 | lock (m_primTerseUpdates) |
3682 | { | 3667 | { |
3683 | if (m_primTerseUpdates.Count == 0) | 3668 | if (m_primTerseUpdates.Count == 0) |
3684 | stopTimer = true; | 3669 | { |
3685 | } | 3670 | lock (m_primTerseUpdateTimer) |
3686 | if (stopTimer) | 3671 | m_primTerseUpdateTimer.Stop(); |
3687 | { | ||
3688 | lock (m_primTerseUpdateTimer) | ||
3689 | m_primTerseUpdateTimer.Stop(); | ||
3690 | 3672 | ||
3691 | return; | 3673 | return; |
3692 | } | 3674 | } |
3693 | 3675 | ||
3694 | ImprovedTerseObjectUpdatePacket outPacket = | 3676 | ImprovedTerseObjectUpdatePacket outPacket = |
3695 | (ImprovedTerseObjectUpdatePacket) | 3677 | (ImprovedTerseObjectUpdatePacket) |
3696 | PacketPool.Instance.GetPacket( | 3678 | PacketPool.Instance.GetPacket( |
3697 | PacketType.ImprovedTerseObjectUpdate); | 3679 | PacketType.ImprovedTerseObjectUpdate); |
3698 | 3680 | ||
3699 | outPacket.RegionData.RegionHandle = | 3681 | outPacket.RegionData.RegionHandle = |
3700 | Scene.RegionInfo.RegionHandle; | 3682 | Scene.RegionInfo.RegionHandle; |
3701 | outPacket.RegionData.TimeDilation = | 3683 | outPacket.RegionData.TimeDilation = |
3702 | (ushort)(Scene.TimeDilation * ushort.MaxValue); | 3684 | (ushort)(Scene.TimeDilation * ushort.MaxValue); |
3703 | 3685 | ||
3704 | int max = m_primTerseUpdates.Count; | 3686 | int max = m_primTerseUpdates.Count; |
3705 | if (max > m_primTerseUpdatesPerPacket) | 3687 | if (max > m_primTerseUpdatesPerPacket) |
3706 | max = m_primTerseUpdatesPerPacket; | 3688 | max = m_primTerseUpdatesPerPacket; |
3707 | 3689 | ||
3708 | int count = 0; | 3690 | int count = 0; |
3709 | int size = 0; | 3691 | int size = 0; |
3710 | 3692 | ||
3711 | byte[] zerobuffer = new byte[1024]; | 3693 | byte[] zerobuffer = new byte[1024]; |
3712 | byte[] blockbuffer = new byte[1024]; | 3694 | byte[] blockbuffer = new byte[1024]; |
3713 | 3695 | ||
3714 | lock (m_primTerseUpdates) | 3696 | for (count = 0 ; count < max ; count++) |
3715 | { | ||
3716 | for (count = 0; count < max; count++) | ||
3717 | { | 3697 | { |
3718 | int length = 0; | 3698 | int length = 0; |
3719 | m_primTerseUpdates[count].ToBytes(blockbuffer, ref length); | 3699 | m_primTerseUpdates[count].ToBytes(blockbuffer, ref length); |
@@ -3738,11 +3718,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3738 | OutPacket(outPacket, ThrottleOutPacketType.Task); | 3718 | OutPacket(outPacket, ThrottleOutPacketType.Task); |
3739 | 3719 | ||
3740 | if (m_primTerseUpdates.Count == 0) | 3720 | if (m_primTerseUpdates.Count == 0) |
3741 | stopTimer = true; | 3721 | lock (m_primTerseUpdateTimer) |
3722 | m_primTerseUpdateTimer.Stop(); | ||
3742 | } | 3723 | } |
3743 | if (stopTimer) | ||
3744 | lock (m_primTerseUpdateTimer) | ||
3745 | m_primTerseUpdateTimer.Stop(); | ||
3746 | } | 3724 | } |
3747 | 3725 | ||
3748 | public void FlushPrimUpdates() | 3726 | public void FlushPrimUpdates() |