-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathzthread.patch
157 lines (104 loc) · 3.34 KB
/
zthread.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
--- ZThread-2.3.2_orig/include/zthread/Guard.h
+++ ZThread-2.3.2_patched/include/zthread/Guard.h
@@ -114,11 +114,9 @@
if(!Scope2::createScope(l, ms)) {
Scope1::destroyScope(l);
- return false;
}
- return true;
}
@@ -428,7 +426,7 @@
template <class U, class V>
Guard(Guard<U, V>& g) : LockHolder<LockType>(g) {
- LockingPolicy::shareScope(*this, extract(g));
+ LockingPolicy::shareScope(*this, this->extract(g));
}
@@ -458,7 +456,7 @@
template <class U, class V>
Guard(Guard<U, V>& g, LockType& lock) : LockHolder<LockType>(lock) {
- LockingPolicy::transferScope(*this, extract(g));
+ LockingPolicy::transferScope(*this, this->extract(g));
}
@@ -491,7 +489,7 @@
try {
- if(!isDisabled())
+ if(!LockHolder<LockType>::isDisabled())
LockingPolicy::destroyScope(*this);
} catch (...) { /* ignore */ }
--- ZThread-2.3.2_orig/share/pthread.m4
+++ ZThread-2.3.2_patched/share/pthread.m4
@@ -36,7 +36,7 @@
GNU Pth can also be used if it was configured with --enable-pthread.
EOF
-AC_DEFUN(AM_DETECT_PTHREAD,
+AC_DEFUN([AM_DETECT_PTHREAD],
[
pthread_explicit="no"
--- ZThread-2.3.2_orig/share/zthread.m4
+++ ZThread-2.3.2_patched/share/zthread.m4
@@ -31,7 +31,7 @@
dnl ZTHREAD_CXXFLAGS
dnl ZTHREAD_LIBS
dnl
-AC_DEFUN(AM_PATH_ZTHREAD,
+AC_DEFUN([AM_PATH_ZTHREAD],
[
--- ZThread-2.3.2_orig/src/MutexImpl.h
+++ ZThread-2.3.2_patched/src/MutexImpl.h
@@ -153,7 +153,7 @@
_owner = self;
- ownerAcquired(self);
+ MutexImpl<List,Behavior>::ownerAcquired(self);
}
@@ -164,7 +164,7 @@
_waiters.insert(self);
m.acquire();
- waiterArrived(self);
+ MutexImpl<List, Behavior>::waiterArrived(self);
{
@@ -173,7 +173,7 @@
}
- waiterDeparted(self);
+ MutexImpl<List, Behavior>::waiterDeparted(self);
m.release();
@@ -192,7 +192,7 @@
assert(_owner == 0);
_owner = self;
- ownerAcquired(self);
+ MutexImpl<List, Behavior>::ownerAcquired(self);
break;
@@ -236,7 +236,7 @@
_owner = self;
- ownerAcquired(self);
+ MutexImpl<List, Behavior>::ownerAcquired(self);
}
@@ -253,7 +253,7 @@
m.acquire();
- waiterArrived(self);
+ MutexImpl<List, Behavior>:: waiterArrived(self);
{
@@ -262,7 +262,7 @@
}
- waiterDeparted(self);
+ MutexImpl<List, Behavior>::waiterDeparted(self);
m.release();
@@ -284,7 +284,7 @@
assert(0 == _owner);
_owner = self;
- ownerAcquired(self);
+ MutexImpl<List, Behavior>::ownerAcquired(self);
break;
@@ -326,7 +326,7 @@
_owner = 0;
- ownerReleased(impl);
+ MutexImpl<List, Behavior>::ownerReleased(impl);
// Try to find a waiter with a backoff & retry scheme
for(;;) {
--- ZThread-2.3.2_orig/src/linux/FastRecursiveLock.h
+++ ZThread-2.3.2_patched/src/linux/FastRecursiveLock.h
@@ -46,7 +46,7 @@
inline FastRecursiveLock() {
- static const pthread_mutexattr_t attr = { PTHREAD_MUTEX_RECURSIVE_NP };
+ static const pthread_mutexattr_t attr = { PTHREAD_MUTEX_RECURSIVE };
pthread_mutex_init(&_mtx, &attr);
}