1 /* |
1 /* |
2 * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
68 public: |
68 public: |
69 // Initialize this queue to contain a null buffer, and be part of the |
69 // Initialize this queue to contain a null buffer, and be part of the |
70 // given PtrQueueSet. |
70 // given PtrQueueSet. |
71 PtrQueue(PtrQueueSet* qset, bool perm = false, bool active = false); |
71 PtrQueue(PtrQueueSet* qset, bool perm = false, bool active = false); |
72 // Release any contained resources. |
72 // Release any contained resources. |
73 void flush(); |
73 virtual void flush(); |
74 // Calls flush() when destroyed. |
74 // Calls flush() when destroyed. |
75 ~PtrQueue() { flush(); } |
75 ~PtrQueue() { flush(); } |
76 |
76 |
77 // Associate a lock with a ptr queue. |
77 // Associate a lock with a ptr queue. |
78 void set_lock(Mutex* lock) { _lock = lock; } |
78 void set_lock(Mutex* lock) { _lock = lock; } |