*/
using System;
-using System.Collections.Generic;
+using System.Collections.Concurrent;
using System.Threading;
namespace Tizen.Applications
{
private readonly Interop.Glib.GSourceFunc _wrapperHandler;
private readonly Object _transactionLock = new Object();
- private readonly Dictionary<int, Action> _handlerMap = new Dictionary<int, Action>();
+ private readonly ConcurrentDictionary<int, Action> _handlerMap = new ConcurrentDictionary<int, Action>();
private int _transactionId = 0;
/// <summary>
{
id = _transactionId++;
}
- _handlerMap.Add(id, action);
+ _handlerMap.TryAdd(id, action);
Interop.Glib.IdleAdd(_wrapperHandler, (IntPtr)id);
}
int key = (int)userData;
if (_handlerMap.ContainsKey(key))
{
- _handlerMap[key]();
- _handlerMap.Remove(key);
+ Action action;
+ _handlerMap.TryRemove(key, out action);
+ action?.Invoke();
}
return false;
}
Name: csapi-application
Summary: Tizen Application API for C#
-Version: 1.0.2
+Version: 1.0.3
Release: 1
Group: Development/Libraries
License: Apache-2.0
%files
%manifest %{name}.manifest
%license LICENSE
-%attr(644,root,root) %{dotnet_assembly_files}
\ No newline at end of file
+%attr(644,root,root) %{dotnet_assembly_files}