diff options
author | Vijay Pai <vpai@google.com> | 2016-11-01 17:16:55 -0700 |
---|---|---|
committer | Vijay Pai <vpai@google.com> | 2016-11-01 17:16:55 -0700 |
commit | 320ed13d3e6c568d3db6a39b85ebbc080f7ee083 (patch) | |
tree | 8da3eeb3e495031e6cebbc2ca1d31f2354db98ae /include | |
parent | 5c41bab92cb65d57def5eca8f83da1beb4ae5f40 (diff) |
Deprecate grpc::thread and sync in favor of std::thread,mutex,etc
Diffstat (limited to 'include')
-rw-r--r-- | include/grpc++/impl/codegen/client_context.h | 4 | ||||
-rw-r--r-- | include/grpc++/impl/codegen/sync.h | 49 | ||||
-rw-r--r-- | include/grpc++/impl/sync.h | 39 | ||||
-rw-r--r-- | include/grpc++/impl/thd.h | 45 | ||||
-rw-r--r-- | include/grpc++/server.h | 7 |
5 files changed, 6 insertions, 138 deletions
diff --git a/include/grpc++/impl/codegen/client_context.h b/include/grpc++/impl/codegen/client_context.h index 9b156bdc41..777b2f8847 100644 --- a/include/grpc++/impl/codegen/client_context.h +++ b/include/grpc++/impl/codegen/client_context.h @@ -51,6 +51,7 @@ #include <map> #include <memory> +#include <mutex> #include <string> #include <grpc++/impl/codegen/config.h> @@ -59,7 +60,6 @@ #include <grpc++/impl/codegen/security/auth_context.h> #include <grpc++/impl/codegen/status.h> #include <grpc++/impl/codegen/string_ref.h> -#include <grpc++/impl/codegen/sync.h> #include <grpc++/impl/codegen/time.h> #include <grpc/impl/codegen/compression_types.h> #include <grpc/impl/codegen/propagation_bits.h> @@ -366,7 +366,7 @@ class ClientContext { bool idempotent_; bool cacheable_; std::shared_ptr<Channel> channel_; - grpc::mutex mu_; + std::mutex mu_; grpc_call* call_; bool call_canceled_; gpr_timespec deadline_; diff --git a/include/grpc++/impl/codegen/sync.h b/include/grpc++/impl/codegen/sync.h deleted file mode 100644 index b94649b79f..0000000000 --- a/include/grpc++/impl/codegen/sync.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * - * Copyright 2015, Google Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#ifndef GRPCXX_IMPL_CODEGEN_SYNC_H -#define GRPCXX_IMPL_CODEGEN_SYNC_H - -#include <condition_variable> -#include <mutex> - -namespace grpc { - -using std::condition_variable; -using std::mutex; -using std::lock_guard; -using std::unique_lock; - -} // namespace grpc - -#endif // GRPCXX_IMPL_CODEGEN_SYNC_H diff --git a/include/grpc++/impl/sync.h b/include/grpc++/impl/sync.h deleted file mode 100644 index 3339cddba4..0000000000 --- a/include/grpc++/impl/sync.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * - * Copyright 2015, Google Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#ifndef GRPCXX_IMPL_SYNC_H -#define GRPCXX_IMPL_SYNC_H - -#include <grpc++/impl/codegen/sync.h> - -#endif // GRPCXX_IMPL_SYNC_H diff --git a/include/grpc++/impl/thd.h b/include/grpc++/impl/thd.h deleted file mode 100644 index 87e1005d97..0000000000 --- a/include/grpc++/impl/thd.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * - * Copyright 2015, Google Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#ifndef GRPCXX_IMPL_THD_H -#define GRPCXX_IMPL_THD_H - -#include <thread> - -namespace grpc { - -using std::thread; - -} // namespace grpc - -#endif // GRPCXX_IMPL_THD_H diff --git a/include/grpc++/server.h b/include/grpc++/server.h index 8035c63da4..fba9952e6e 100644 --- a/include/grpc++/server.h +++ b/include/grpc++/server.h @@ -34,8 +34,10 @@ #ifndef GRPCXX_SERVER_H #define GRPCXX_SERVER_H +#include <condition_variable> #include <list> #include <memory> +#include <mutex> #include <vector> #include <grpc++/completion_queue.h> @@ -43,7 +45,6 @@ #include <grpc++/impl/codegen/grpc_library.h> #include <grpc++/impl/codegen/server_interface.h> #include <grpc++/impl/rpc_service_method.h> -#include <grpc++/impl/sync.h> #include <grpc++/security/server_credentials.h> #include <grpc++/support/channel_arguments.h> #include <grpc++/support/config.h> @@ -197,12 +198,12 @@ class Server final : public ServerInterface, private GrpcLibraryCodegen { std::vector<std::unique_ptr<SyncRequestThreadManager>> sync_req_mgrs_; // Sever status - grpc::mutex mu_; + std::mutex mu_; bool started_; bool shutdown_; bool shutdown_notified_; // Was notify called on the shutdown_cv_ - grpc::condition_variable shutdown_cv_; + std::condition_variable shutdown_cv_; std::shared_ptr<GlobalCallbacks> global_callbacks_; |