equal
deleted
inserted
replaced
29 #include "runtime/mutex.hpp" |
29 #include "runtime/mutex.hpp" |
30 #include "runtime/mutexLocker.hpp" |
30 #include "runtime/mutexLocker.hpp" |
31 #include "runtime/thread.inline.hpp" |
31 #include "runtime/thread.inline.hpp" |
32 |
32 |
33 PtrQueue::PtrQueue(PtrQueueSet* qset, bool perm, bool active) : |
33 PtrQueue::PtrQueue(PtrQueueSet* qset, bool perm, bool active) : |
34 _qset(qset), _buf(NULL), _index(0), _active(active), |
34 _qset(qset), _buf(NULL), _index(0), _sz(0), _active(active), |
35 _perm(perm), _lock(NULL) |
35 _perm(perm), _lock(NULL) |
36 {} |
36 {} |
37 |
37 |
38 void PtrQueue::flush() { |
38 PtrQueue::~PtrQueue() { |
|
39 assert(_perm || (_buf == NULL), "queue must be flushed before delete"); |
|
40 } |
|
41 |
|
42 void PtrQueue::flush_impl() { |
39 if (!_perm && _buf != NULL) { |
43 if (!_perm && _buf != NULL) { |
40 if (_index == _sz) { |
44 if (_index == _sz) { |
41 // No work to do. |
45 // No work to do. |
42 qset()->deallocate_buffer(_buf); |
46 qset()->deallocate_buffer(_buf); |
43 } else { |
47 } else { |