Skip to content

Commit

Permalink
Also Start any stopped worker threads in main Start() command
Browse files Browse the repository at this point in the history
  • Loading branch information
mythz committed Sep 21, 2012
1 parent 1aaca5d commit 4666ca6
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/ServiceStack.Redis/Messaging/RedisMqServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,12 @@ public void Init()

public void Start()
{
if (Interlocked.CompareExchange(ref status, 0, 0) == WorkerStatus.Started) return;
if (Interlocked.CompareExchange(ref status, 0, 0) == WorkerStatus.Started)
{
//Start any stopped worker threads
StartWorkerThreads();
return;
}
if (Interlocked.CompareExchange(ref status, 0, 0) == WorkerStatus.Disposed)
throw new ObjectDisposedException("MQ Host has been disposed");

Expand Down Expand Up @@ -304,13 +309,6 @@ public void Stop()
}
}

public void StartAll()
{
Log.Debug("Starting Redis MQ Server Master RunLoop and all worker threads...");
Start();
Array.ForEach(workers, x => x.Start());
}

public void StartWorkerThreads()
{
Log.Debug("Starting all Redis MQ Server worker threads...");
Expand Down

0 comments on commit 4666ca6

Please sign in to comment.