Details
-
Improvement
-
Status: Open
-
Major
-
Resolution: Unresolved
-
2.8.0
-
None
-
None
Description
#9817 Closing check Before Producer's BufferPool allocat memory
According to the idea of #7967, it made BufferPool support closing.
Now, there are two places in the BufferPool#allocate() method to judge the 'closed' flag. One is when 'lock' is acquired, and the other is when 'condition' is awakened.
However, if the memory is allocated outside the 'lock' code block after 'freeup',
Therefore, it is possible for another thread to modify the 'closed' flag, causing this part of memory to be allocated in vain.
So two modifications have been made,
One is to add the 'volatile' modifier before 'closed',
One is to determine whether to 'closed' before allocating memory.
Attachments
Issue Links
- links to