Add lock for input proxy.
This commit is contained in:
@@ -102,12 +102,15 @@ namespace Cryville.Crtr {
|
|||||||
#region Handling
|
#region Handling
|
||||||
public void Activate() { foreach (var src in _sproxies.Keys) src.Handler.Activate(); }
|
public void Activate() { foreach (var src in _sproxies.Keys) src.Handler.Activate(); }
|
||||||
public void Deactivate() { foreach (var src in _sproxies.Keys) src.Handler.Deactivate(); }
|
public void Deactivate() { foreach (var src in _sproxies.Keys) src.Handler.Deactivate(); }
|
||||||
|
readonly object _lock = new object();
|
||||||
void OnInput(InputIdentifier id, InputVector vec) {
|
void OnInput(InputIdentifier id, InputVector vec) {
|
||||||
|
lock (_lock) {
|
||||||
InputProxyEntry proxy;
|
InputProxyEntry proxy;
|
||||||
if (_sproxies.TryGetValue(id.Source, out proxy)) {
|
if (_sproxies.TryGetValue(id.Source, out proxy)) {
|
||||||
OnInput(id, vec, proxy.Target);
|
OnInput(id, vec, proxy.Target);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
static readonly int _var_value = IdentifierManager.SharedInstance.Request("value");
|
static readonly int _var_value = IdentifierManager.SharedInstance.Request("value");
|
||||||
static readonly PropOp.Arbitrary _arbop = new PropOp.Arbitrary();
|
static readonly PropOp.Arbitrary _arbop = new PropOp.Arbitrary();
|
||||||
readonly byte[] _vecbuf = new byte[3 * sizeof(float) + sizeof(int)];
|
readonly byte[] _vecbuf = new byte[3 * sizeof(float) + sizeof(int)];
|
||||||
|
Reference in New Issue
Block a user