1.1 --- a/libfsserver/lib/pipes/pipe_paging.cc Wed May 05 00:09:11 2021 +0200
1.2 +++ b/libfsserver/lib/pipes/pipe_paging.cc Fri May 07 00:31:02 2021 +0200
1.3 @@ -36,10 +36,19 @@
1.4 _queue = new PageQueuePartitioned();
1.5 _pages = new Pages(_memory, _queue);
1.6
1.7 + /* Reset the mappers associated with the regions. */
1.8 +
1.9 for (unsigned int i = 0; i < 2; i++)
1.10 _regions[i] = NULL;
1.11 }
1.12
1.13 +/* Return whether one or more endpoints have detached. */
1.14 +
1.15 +int PipePaging::closed()
1.16 +{
1.17 + return _endpoints < 2;
1.18 +}
1.19 +
1.20 /* Detach one endpoint. */
1.21
1.22 void PipePaging::detach()
1.23 @@ -131,9 +140,12 @@
1.24 delete mapper;
1.25 }
1.26
1.27 - /* Return the next region. */
1.28 + /* Select the next region. */
1.29
1.30 _reading = 1 - _reading;
1.31 +
1.32 + /* Return the next region's mapper. */
1.33 +
1.34 return _regions[_reading];
1.35 }
1.36