equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2015, 2018, 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. |
42 // |
42 // |
43 // Each instance keeps track of the number of current readers of the list. |
43 // Each instance keeps track of the number of current readers of the list. |
44 // To remove a node from the list the node must first be unlinked, |
44 // To remove a node from the list the node must first be unlinked, |
45 // and the memory for that node can be freed whenever the removing |
45 // and the memory for that node can be freed whenever the removing |
46 // thread observes an active reader count of 0 (after unlinking it). |
46 // thread observes an active reader count of 0 (after unlinking it). |
47 class LogOutputList VALUE_OBJ_CLASS_SPEC { |
47 class LogOutputList { |
48 private: |
48 private: |
49 struct LogOutputNode : public CHeapObj<mtLogging> { |
49 struct LogOutputNode : public CHeapObj<mtLogging> { |
50 LogOutput* _value; |
50 LogOutput* _value; |
51 LogOutputNode* _next; |
51 LogOutputNode* _next; |
52 LogLevelType _level; |
52 LogLevelType _level; |
86 } |
86 } |
87 |
87 |
88 // Set (add/update/remove) the output to the specified level. |
88 // Set (add/update/remove) the output to the specified level. |
89 void set_output_level(LogOutput* output, LogLevelType level); |
89 void set_output_level(LogOutput* output, LogLevelType level); |
90 |
90 |
91 class Iterator VALUE_OBJ_CLASS_SPEC { |
91 class Iterator { |
92 friend class LogOutputList; |
92 friend class LogOutputList; |
93 private: |
93 private: |
94 LogOutputNode* _current; |
94 LogOutputNode* _current; |
95 LogOutputList* _list; |
95 LogOutputList* _list; |
96 Iterator(LogOutputList* list, LogOutputNode* start) : _current(start), _list(list) { |
96 Iterator(LogOutputList* list, LogOutputNode* start) : _current(start), _list(list) { |