File tree Expand file tree Collapse file tree 1 file changed +9
-15
lines changed Expand file tree Collapse file tree 1 file changed +9
-15
lines changed Original file line number Diff line number Diff line change @@ -54,12 +54,13 @@ namespace geode
5454
5555 ~Storage ()
5656 {
57- terminate_storage ();
58- std::unique_lock< std::mutex > locking{ lock_ };
59- condition_.wait ( locking, [this ] {
60- clean_queue ();
61- return queue_.empty ();
62- } );
57+ terminate_ = true ;
58+ condition_.notify_all ();
59+ while ( !queue_.empty () )
60+ {
61+ queue_.front ().wait ();
62+ queue_.pop ();
63+ }
6364 }
6465
6566 bool expired () const
@@ -110,23 +111,16 @@ namespace geode
110111 }
111112
112113 private:
113- void terminate_storage ()
114- {
115- terminate_ = true ;
116- condition_.notify_all ();
117- }
118-
119114 void clean_queue ()
120115 {
121116 while ( !queue_.empty () )
122117 {
123118 if ( !queue_.front ().ready () )
124119 {
125- break ;
120+ return ;
126121 }
127122 queue_.pop ();
128123 }
129- condition_.notify_all ();
130124 }
131125
132126 void wait_for_memory_release ()
@@ -145,7 +139,7 @@ namespace geode
145139 }
146140 }
147141 locking.unlock ();
148- condition_.notify_all ();
142+ // condition_.notify_all();
149143 } ) );
150144 }
151145
You can’t perform that action at this time.
0 commit comments