[PATCH] D41831: Minor code cleanup

Terry Wilmarth via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 9 12:15:38 PST 2018


tlwilmar added inline comments.


================
Comment at: runtime/src/kmp_runtime.cpp:5537
+  __kmp_free_implicit_task(this_th);
+  this_th->th.th_current_task = NULL;
+
----------------
protze.joachim wrote:
> AndreyChurbanov wrote:
> > protze.joachim wrote:
> > > Is there a reason for not putting this into the `__kmp_free_implicit_task` function?
> > There are cases where the thread structure is cleaned to be re-used, then the zeroing makes sense.
> > And in other cases where the thread structure has its memory freed there is no need to zero the contents.
> > 
> > So to me it looks logical to have the assignment here.
> This is the only place, where `__kmp_free_implicit_task` is called. So semantically, there is no difference for moving the assignment into the function.
There is another use of this function in __kmp_reap_thread that does not nullify th_current_task after it.


Repository:
  rL LLVM

https://reviews.llvm.org/D41831





More information about the llvm-commits mailing list