From 80f950da0b05df8054b721c108ac4b8b7cff6ea7 Mon Sep 17 00:00:00 2001 From: Harald Wolff Date: Wed, 11 Sep 2019 09:26:33 +0200 Subject: [PATCH] Added static class ThreadHelpers --- ln.types.csproj | 1 + threads/ThreadHelpers.cs | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 threads/ThreadHelpers.cs diff --git a/ln.types.csproj b/ln.types.csproj index 52f3284..5a162cf 100644 --- a/ln.types.csproj +++ b/ln.types.csproj @@ -96,6 +96,7 @@ + diff --git a/threads/ThreadHelpers.cs b/threads/ThreadHelpers.cs new file mode 100644 index 0000000..9a6ba78 --- /dev/null +++ b/threads/ThreadHelpers.cs @@ -0,0 +1,16 @@ +using System; +namespace ln.types.threads +{ + public static class ThreadHelpers + { + + public static T GetLockedValue(object lockObject,Func getter) + { + lock (lockObject) + { + return getter(); + } + } + + } +}