Skip to content

Commit b0781c8

Browse files
committed
Creating Thread/Task adjusted to use NETFX_CORE condition.
1 parent 1c736ed commit b0781c8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

projects/client/RabbitMQ.Client/src/client/impl/ConsumerWorkService.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,16 @@ public WorkPool(IModel model)
6565

6666
public void Start()
6767
{
68+
#if NETFX_CORE
69+
Task.Factory.StartNew(Loop, TaskCreationOptions.LongRunning);
70+
#else
6871
var thread = new Thread(Loop)
6972
{
7073
Name = "WorkPool-" + name,
7174
IsBackground = true
7275
};
7376
thread.Start();
77+
#endif
7478
}
7579

7680
public void Enqueue(Action action)

0 commit comments

Comments
 (0)