Skip to content

Commit

Permalink
Merge branch 'dev' of github.com:Panxuc/THUAI7 into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
panxuc committed Oct 27, 2023
2 parents 7e3e45c + 66b0b61 commit d988fab
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions logic/GameClass/GameObj/ObjOfShip.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,18 @@ namespace GameClass.GameObj
/// </summary>
public abstract class ObjOfShip : Movable, IObjOfShip
{
private ReaderWriterLockSlim objOfShipReaderWriterLock = new();
public ReaderWriterLockSlim ObjOfShipReaderWriterLock => objOfShipReaderWriterLock;
public object ObjOfShipLock { get; } = new();
private IShip? parent = null;
public IShip? Parent
{
get
{
lock (objOfShipReaderWriterLock)
lock (ObjOfShipLock)
return parent;
}
set
{
lock (objOfShipReaderWriterLock)
lock (ObjOfShipLock)
parent = value;
}
}
Expand Down
2 changes: 1 addition & 1 deletion logic/GameClass/GameObj/Ship.cs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public bool ResetShipStateInOneThread(long state, RunningStateType running = Run
}
public bool StartThread(long stateNum, RunningStateType runningState)
{
lock (ActionLock)
lock (actionLock)
{
if (this.StateNum == stateNum)
{
Expand Down

0 comments on commit d988fab

Please sign in to comment.