From 84fa8af38d2eab0f72349abb8136811bd3e96570 Mon Sep 17 00:00:00 2001 From: Anand Avati Date: Tue, 24 Sep 2013 09:45:08 -0700 Subject: core: block unused signals in created threads Block all signal except those which are set for explicit handling in glusterfs_signals_setup(). Since thread spawning code in libglusterfs and xlators can get called from application threads when used through libgfapi, it is necessary to do this blocking. Change-Id: Ia320f80521a83d2edcda50b9ad414583a0175281 BUG: 1011662 Signed-off-by: Anand Avati Reviewed-on: http://review.gluster.org/5995 Tested-by: Gluster Build System Reviewed-by: Amar Tumballi Reviewed-by: Vijay Bellur --- rpc/rpc-transport/rdma/src/rdma.c | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) (limited to 'rpc/rpc-transport/rdma/src/rdma.c') diff --git a/rpc/rpc-transport/rdma/src/rdma.c b/rpc/rpc-transport/rdma/src/rdma.c index 8ef7d1e3afa..6e6099a9854 100644 --- a/rpc/rpc-transport/rdma/src/rdma.c +++ b/rpc/rpc-transport/rdma/src/rdma.c @@ -619,10 +619,9 @@ gf_rdma_get_device (rpc_transport_t *this, struct ibv_context *ibctx, } /* completion threads */ - ret = pthread_create (&trav->send_thread, - NULL, - gf_rdma_send_completion_proc, - trav->send_chan); + ret = gf_thread_create (&trav->send_thread, NULL, + gf_rdma_send_completion_proc, + trav->send_chan); if (ret) { gf_log (this->name, GF_LOG_ERROR, "could not create send completion thread for " @@ -630,10 +629,9 @@ gf_rdma_get_device (rpc_transport_t *this, struct ibv_context *ibctx, goto out; } - ret = pthread_create (&trav->recv_thread, - NULL, - gf_rdma_recv_completion_proc, - trav->recv_chan); + ret = gf_thread_create (&trav->recv_thread, NULL, + gf_rdma_recv_completion_proc, + trav->recv_chan); if (ret) { gf_log (this->name, GF_LOG_ERROR, "could not create recv completion thread " @@ -641,10 +639,9 @@ gf_rdma_get_device (rpc_transport_t *this, struct ibv_context *ibctx, return NULL; } - ret = pthread_create (&trav->async_event_thread, - NULL, - gf_rdma_async_event_thread, - ibctx); + ret = gf_thread_create (&trav->async_event_thread, NULL, + gf_rdma_async_event_thread, + ibctx); if (ret) { gf_log (this->name, GF_LOG_ERROR, "could not create async_event_thread"); @@ -4198,9 +4195,9 @@ __gf_rdma_ctx_create (void) goto out; } - ret = pthread_create (&rdma_ctx->rdma_cm_thread, NULL, - gf_rdma_cm_event_handler, - rdma_ctx->rdma_cm_event_channel); + ret = gf_thread_create (&rdma_ctx->rdma_cm_thread, NULL, + gf_rdma_cm_event_handler, + rdma_ctx->rdma_cm_event_channel); if (ret != 0) { gf_log (GF_RDMA_LOG_NAME, GF_LOG_WARNING, "creation of thread to handle rdma-cm events " -- cgit