aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.Core/Threading
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2017-12-19 10:25:40 +0200
committerRoy Ben-Shabat <Roy@Twine-s.com>2017-12-19 10:25:40 +0200
commitafc7a07d285e08d905c58dd5978441c155b2f296 (patch)
treea2f4f51ef2747ae3a2aded2637a352ce8ef85934 /Software/Visual_Studio/Tango.Core/Threading
parentad35c9c2df0001157ea13312382f3cdfdad67f06 (diff)
downloadTango-afc7a07d285e08d905c58dd5978441c155b2f296.tar.gz
Tango-afc7a07d285e08d905c58dd5978441c155b2f296.zip
MERGE.
Diffstat (limited to 'Software/Visual_Studio/Tango.Core/Threading')
-rw-r--r--Software/Visual_Studio/Tango.Core/Threading/StaThreadHelper.cs23
1 files changed, 23 insertions, 0 deletions
diff --git a/Software/Visual_Studio/Tango.Core/Threading/StaThreadHelper.cs b/Software/Visual_Studio/Tango.Core/Threading/StaThreadHelper.cs
new file mode 100644
index 000000000..5c1f5b93c
--- /dev/null
+++ b/Software/Visual_Studio/Tango.Core/Threading/StaThreadHelper.cs
@@ -0,0 +1,23 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading;
+using System.Threading.Tasks;
+
+namespace Tango.Core.Threading
+{
+ public static class StaThreadHelper
+ {
+ public static void StartStaThread(Action action)
+ {
+ Thread thread = new Thread(() =>
+ {
+ action();
+ });
+ thread.SetApartmentState(ApartmentState.STA);
+ thread.IsBackground = true;
+ thread.Start();
+ }
+ }
+}