From 0c9b1246c2cdf3745f0ca5e94d23e18cb90993bb Mon Sep 17 00:00:00 2001 From: Wolfgang 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