|
3 | 3 |
|
4 | 4 | #include <stdint.h> |
5 | 5 | #include <stdlib.h> |
6 | | -#include <algorithm> |
7 | | -#include <initializer_list> |
8 | 6 | #include <iostream> |
9 | 7 | #include <map> |
10 | 8 | #include <nlohmann/json.hpp> |
11 | 9 | #include <string> |
12 | 10 | #include <utility> |
13 | 11 | #include <vector> |
14 | 12 |
|
15 | | -#include "opentelemetry/context/context_value.h" |
16 | 13 | #include "opentelemetry/context/propagation/text_map_propagator.h" |
17 | 14 | #include "opentelemetry/context/runtime_context.h" |
18 | 15 | #include "opentelemetry/exporters/ostream/span_exporter.h" |
19 | 16 | #include "opentelemetry/ext/http/client/curl/http_client_curl.h" |
20 | | -#include "opentelemetry/ext/http/client/curl/http_operation_curl.h" |
21 | 17 | #include "opentelemetry/ext/http/client/http_client.h" |
22 | 18 | #include "opentelemetry/ext/http/server/http_server.h" |
23 | 19 | #include "opentelemetry/nostd/shared_ptr.h" |
24 | 20 | #include "opentelemetry/nostd/string_view.h" |
25 | 21 | #include "opentelemetry/sdk/trace/exporter.h" |
26 | 22 | #include "opentelemetry/sdk/trace/processor.h" |
27 | | -#include "opentelemetry/sdk/trace/recordable.h" |
28 | 23 | #include "opentelemetry/sdk/trace/simple_processor.h" |
29 | 24 | #include "opentelemetry/sdk/trace/tracer_context.h" |
30 | 25 | #include "opentelemetry/sdk/trace/tracer_provider.h" |
@@ -243,14 +238,11 @@ int main(int argc, char *argv[]) |
243 | 238 | std::cout << "Listening at http://" << default_host << ":" << port << "/test\n"; |
244 | 239 |
|
245 | 240 | // Wait for signal to stop server |
246 | | - std::thread server_check([&stop_server, &server]() { |
247 | | - while (!stop_server.load()) |
248 | | - { |
249 | | - // keep running the thread |
250 | | - } |
251 | | - // received signal to stop server |
252 | | - std::cout << "stopping server \n"; |
253 | | - server.stop(); |
254 | | - }); |
255 | | - server_check.join(); |
| 241 | + while (!stop_server.load()) |
| 242 | + { |
| 243 | + std::this_thread::sleep_for(std::chrono::seconds(1)); |
| 244 | + } |
| 245 | + // received signal to stop server |
| 246 | + std::cout << "Stopping server \n"; |
| 247 | + server.stop(); |
256 | 248 | } |
0 commit comments