/// <summary>
 /// When the current dependent node is a synchronous task, this method is called before the thread is blocked to wait it to complete.
 /// This adds the current task to the dependingSynchronousTaskTracking list of the task itself (which will propergate through its dependencies.)
 /// After the task is finished, <see cref="OnSynchronousTaskEndToBlockWaiting"/> is called to revert this change.
 /// This method is expected to be used with the JTF lock.
 /// </summary>
 /// <param name="taskItem">The current joinableTask or collection.</param>
 /// <param name="taskHasPendingRequests">Return the JoinableTask which has already had pending requests to be handled.</param>
 /// <param name="pendingRequestsCount">The number of pending requests.</param>
 internal static void OnSynchronousTaskStartToBlockWaiting(JoinableTask taskItem, out JoinableTask?taskHasPendingRequests, out int pendingRequestsCount)
 {
     Requires.NotNull(taskItem, nameof(taskItem));
     Assumes.True(Monitor.IsEntered(taskItem.Factory.Context.SyncContextLock));
     JoinableTaskDependentData.OnSynchronousTaskStartToBlockWaiting(taskItem, out taskHasPendingRequests, out pendingRequestsCount);
 }