Amnesia.SessionTracker.AsyncDependentActivityIdentified C# (CSharp) Method

AsyncDependentActivityIdentified() public method

Called by the thread that is initiating an async activity on a second thread.
public AsyncDependentActivityIdentified ( ) : ActivityInfo
return ActivityInfo
        public ActivityInfo AsyncDependentActivityIdentified()
        {
            var activity = CurrentThreadActivity;
            if (activity == null)
                throw new InvalidOperationException("Expected to join into an existing activity but there is not one");

            lock (fieldsLock)
            {
                ++activity.ThreadCount;
            }

            return activity;
        }

Usage Example

Example #1
0
 public AsyncActivity(SessionTracker tracker)
 {
     this.tracker  = tracker;
     this.activity = tracker.AsyncDependentActivityIdentified();
 }
All Usage Examples Of Amnesia.SessionTracker::AsyncDependentActivityIdentified