From db497b7f0eaa3f93ff59c3519183c1e10a0e5198 Mon Sep 17 00:00:00 2001 From: bangerth Date: Thu, 12 Dec 2013 17:34:45 +0000 Subject: [PATCH] Add a comment. git-svn-id: https://svn.dealii.org/trunk@31983 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/include/deal.II/base/work_stream.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/deal.II/include/deal.II/base/work_stream.h b/deal.II/include/deal.II/base/work_stream.h index 363c28bbc7..63007aba91 100644 --- a/deal.II/include/deal.II/base/work_stream.h +++ b/deal.II/include/deal.II/base/work_stream.h @@ -348,6 +348,15 @@ namespace WorkStream // and have set the ring buffer to have exactly this size. so // if this function is called, we know that less than the // maximal number of items in currently in flight + // + // note that we need not lock access to this array since + // the current stage is run sequentially and we can therefore + // enter the following block only once at any given time. + // thus, there can be no race condition between checking that + // a flag is false and setting it to true. (there may be + // another thread where we release items and set 'false' + // flags to 'true', but that too does not produce any + // problems) ItemType *current_item = 0; for (unsigned int i=0; i