7
7
8
8
// class sync_queue<T>
9
9
10
- // push || pull ;
10
+ // push_back || pull_front ;
11
11
12
12
#include < boost/config.hpp>
13
13
#if ! defined BOOST_NO_CXX11_DECLTYPE
@@ -35,7 +35,7 @@ struct call_push
35
35
void operator ()()
36
36
{
37
37
go_.count_down_and_wait ();
38
- q_.push (42 );
38
+ q_.push_back (42 );
39
39
40
40
}
41
41
};
@@ -54,7 +54,7 @@ struct call_push_2
54
54
void operator ()()
55
55
{
56
56
go_.count_down_and_wait ();
57
- q_.push (42 );
57
+ q_.push_back (42 );
58
58
end_.count_down_and_wait ();
59
59
60
60
}
@@ -73,7 +73,7 @@ struct call_pull
73
73
int operator ()()
74
74
{
75
75
go_.count_down_and_wait ();
76
- return q_.pull ();
76
+ return q_.pull_front ();
77
77
}
78
78
};
79
79
@@ -93,7 +93,7 @@ void test_concurrent_push_and_pull_on_empty_queue()
93
93
[&q,&go]()
94
94
{
95
95
go.wait ();
96
- q.push (42 );
96
+ q.push_back (42 );
97
97
}
98
98
#else
99
99
call_push (q,go)
@@ -104,7 +104,7 @@ void test_concurrent_push_and_pull_on_empty_queue()
104
104
[&q,&go]() -> int
105
105
{
106
106
go.wait ();
107
- return q.pull ();
107
+ return q.pull_front ();
108
108
}
109
109
#else
110
110
call_pull (q,go)
@@ -136,7 +136,7 @@ void test_concurrent_push_on_empty_queue()
136
136
[&q,&go]()
137
137
{
138
138
go.wait ();
139
- q.push (42 );
139
+ q.push_back (42 );
140
140
}
141
141
#else
142
142
call_push (q,go)
@@ -148,7 +148,7 @@ void test_concurrent_push_on_empty_queue()
148
148
149
149
BOOST_TEST (!q.empty ());
150
150
for (unsigned int i =0 ; i< n; ++i)
151
- BOOST_TEST_EQ (q.pull (), 42 );
151
+ BOOST_TEST_EQ (q.pull_front (), 42 );
152
152
BOOST_TEST (q.empty ());
153
153
154
154
}
@@ -175,7 +175,7 @@ void test_concurrent_push_on_full_queue()
175
175
[&q,&go,&end]()
176
176
{
177
177
go.wait ();
178
- q.push (42 );
178
+ q.push_back (42 );
179
179
end.wait ();
180
180
}
181
181
#else
@@ -187,15 +187,15 @@ void test_concurrent_push_on_full_queue()
187
187
BOOST_TEST (!q.empty ());
188
188
BOOST_TEST (q.full ());
189
189
for (unsigned int i =0 ; i< size; ++i)
190
- BOOST_TEST_EQ (q.pull (), 42 );
190
+ BOOST_TEST_EQ (q.pull_front (), 42 );
191
191
end.wait ();
192
192
193
193
for (unsigned int i = 0 ; i < n; ++i)
194
194
push_done[i].get ();
195
195
196
196
BOOST_TEST (!q.empty ());
197
197
for (unsigned int i =0 ; i< size; ++i)
198
- BOOST_TEST_EQ (q.pull (), 42 );
198
+ BOOST_TEST_EQ (q.pull_front (), 42 );
199
199
BOOST_TEST (q.empty ());
200
200
201
201
}
@@ -215,15 +215,15 @@ void test_concurrent_pull_on_queue()
215
215
try
216
216
{
217
217
for (unsigned int i =0 ; i< n; ++i)
218
- q.push (42 );
218
+ q.push_back (42 );
219
219
220
220
for (unsigned int i =0 ; i< n; ++i)
221
221
pull_done[i]=boost::async (boost::launch::async,
222
222
#if ! defined BOOST_NO_CXX11_LAMBDAS
223
223
[&q,&go]() -> int
224
224
{
225
225
go.wait ();
226
- return q.pull ();
226
+ return q.pull_front ();
227
227
}
228
228
#else
229
229
call_pull (q,go)
0 commit comments