File tree Expand file tree Collapse file tree 3 files changed +25
-2
lines changed Expand file tree Collapse file tree 3 files changed +25
-2
lines changed Original file line number Diff line number Diff line change 1
1
---
2
- refs/heads/master: b03812af2b65a31c567945a1c41515602ff92c20
2
+ refs/heads/master: 5375b3916095970bc87675969b2fb00d9bebcfd8
Original file line number Diff line number Diff line change @@ -10,6 +10,15 @@ class indexed_list_object {
10
10
int32_t list_index;
11
11
};
12
12
13
+ template <typename T>
14
+ class indexed_list_element : public indexed_list_object {
15
+ public:
16
+ T value;
17
+ indexed_list_element (T value) : value(value) {
18
+ // Nop;
19
+ }
20
+ };
21
+
13
22
/* *
14
23
* An array list of objects that are aware of their position in the list.
15
24
* Normally, objects in this list should derive from the base class
Original file line number Diff line number Diff line change @@ -7,7 +7,14 @@ template<typename T> class synchronized_indexed_list :
7
7
public indexed_list<T> {
8
8
spin_lock _lock;
9
9
public:
10
- synchronized_indexed_list (memory_region ®ion) :
10
+ /* *
11
+ * Clients can use this global lock that is associated with the list to
12
+ * perform more coarse grained locking. Internally, the synchronized list
13
+ * doesn'tactually make any use of this lock.
14
+ */
15
+ spin_lock global;
16
+
17
+ synchronized_indexed_list (memory_region *region) :
11
18
indexed_list<T>(region) {
12
19
// Nop.
13
20
}
@@ -20,6 +27,13 @@ template<typename T> class synchronized_indexed_list :
20
27
return index;
21
28
}
22
29
30
+ bool pop (T **value) {
31
+ _lock.lock ();
32
+ bool result = indexed_list<T>::pop (value);
33
+ _lock.unlock ();
34
+ return result;
35
+ }
36
+
23
37
size_t length () {
24
38
size_t length = 0 ;
25
39
_lock.lock ();
You can’t perform that action at this time.
0 commit comments