Updated comments on sync context.

This commit is contained in:
soukoku
2014-05-14 19:58:45 -04:00
parent fb427437d7
commit ee2cbfa5e4
4 changed files with 28 additions and 25 deletions

View File

@@ -564,6 +564,8 @@ namespace NTwain
var syncer = SynchronizationContext;
if (syncer == null)
{
Debug.WriteLine(string.Format(CultureInfo.InvariantCulture, "Trying to raise event {0} on thread {1} without sync.", e.GetType().Name, Thread.CurrentThread.ManagedThreadId));
try
{
onEventFunc(e);
@@ -573,6 +575,8 @@ namespace NTwain
}
else
{
Debug.WriteLine(string.Format(CultureInfo.InvariantCulture, "Trying to raise event {0} on thread {1} with sync.", e.GetType().Name, Thread.CurrentThread.ManagedThreadId));
// on some consumer desktop scanner with poor drivers this can frequently hang. there's nothing I can do here.
syncer.Send(o =>
{
try