1.1 --- a/libfsserver/lib/pages/page_queue_partitioned.cc Sat May 11 23:53:40 2024 +0200
1.2 +++ b/libfsserver/lib/pages/page_queue_partitioned.cc Tue Jun 25 13:53:18 2024 +0200
1.3 @@ -1,7 +1,7 @@
1.4 /*
1.5 * A page queue retaining two internal collections of memory pages.
1.6 *
1.7 - * Copyright (C) 2021 Paul Boddie <paul@boddie.org.uk>
1.8 + * Copyright (C) 2021, 2024 Paul Boddie <paul@boddie.org.uk>
1.9 *
1.10 * This program is free software; you can redistribute it and/or
1.11 * modify it under the terms of the GNU General Public License as
1.12 @@ -27,6 +27,8 @@
1.13
1.14 void PageQueuePartitioned::close(Memory *memory)
1.15 {
1.16 + std::lock_guard<std::mutex> guard(_lock);
1.17 +
1.18 discard(_available, memory);
1.19 discard(_issued, memory);
1.20 }
1.21 @@ -127,6 +129,8 @@
1.22
1.23 bool PageQueuePartitioned::remove(PageOwner *owner, Flexpage *flexpage)
1.24 {
1.25 + std::lock_guard<std::mutex> guard(_lock);
1.26 +
1.27 return PageQueue::remove(_issued, _positions, owner, flexpage);
1.28 }
1.29