From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sasha Khapyorsky Subject: Re: [PATCH 1/2] contain pthreads defs with ifdef HAVE_LIBPTHREAD Date: Fri, 6 Nov 2009 18:58:34 +0200 Message-ID: <20091106165834.GE7192@me> References: <74DB7ADB8B154DE69B8F65456193D483@amr.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <74DB7ADB8B154DE69B8F65456193D483@amr.corp.intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: ofw-bounces@lists.openfabrics.org Errors-To: ofw-bounces@lists.openfabrics.org To: Sean Hefty Cc: linux-rdma@vger.kernel.org, ofw@lists.openfabrics.org List-Id: linux-rdma@vger.kernel.org On 13:05 Wed 04 Nov , Sean Hefty wrote: > >Contain pthread definitions with ifdef HAVE_LIBPTHREAD > > > >Signed-off-by: stan smith > > > >diff --git a/opensm/include/vendor/osm_vendor_ibumad.h > >b/opensm/include/vendor/osm_vendor_ibumad.h > >index 0a4692d..d523412 100644 > >--- a/opensm/include/vendor/osm_vendor_ibumad.h > >+++ b/opensm/include/vendor/osm_vendor_ibumad.h > >@@ -160,8 +160,13 @@ typedef struct _osm_vendor { > > char ca_names[OSM_UMAD_MAX_CAS][UMAD_CA_NAME_LEN]; > > vendor_match_tbl_t mtbl; > > umad_port_t umad_port; > >+#ifdef HAVE_LIBPTHREAD > > pthread_mutex_t cb_mutex; > > pthread_mutex_t match_tbl_mutex; > >+#else > >+ cl_mutex_t cb_mutex; > >+ cl_mutex_t match_tbl_mutex; > >+#endif > > complib is available on both platforms, why not just use it? We don't have cl_mutex_t in linux's implementation. I didn't know that complib on windows already implements semantics which are similar to most useful pthread things. That is good, and seems that an easy porting could be done by using macros like: #define pthread_* cl_thread_* Sasha