Fix build errors on catamount related to HAVE_LIBPTHREAD not being defined.
Original patch by walter.
b=12147
i=adilger
i=scjody
#define LNET_MUTEX_DOWN(m) mutex_down(m)
#define LNET_MUTEX_UP(m) mutex_up(m)
#else
#define LNET_MUTEX_DOWN(m) mutex_down(m)
#define LNET_MUTEX_UP(m) mutex_up(m)
#else
+# ifndef HAVE_LIBPTHREAD
#define LNET_SINGLE_THREADED_LOCK(l) \
do { \
LASSERT ((l) == 0); \
#define LNET_SINGLE_THREADED_LOCK(l) \
do { \
LASSERT ((l) == 0); \
struct semaphore ln_api_mutex;
struct semaphore ln_lnd_mutex;
#else
struct semaphore ln_api_mutex;
struct semaphore ln_lnd_mutex;
#else
+# ifndef HAVE_LIBPTHREAD
int ln_lock;
int ln_api_mutex;
int ln_lnd_mutex;
int ln_lock;
int ln_api_mutex;
int ln_lnd_mutex;
+# ifndef HAVE_LIBPTHREAD
void lnet_init_locks(void)
{
void lnet_init_locks(void)
{
the_lnet.ln_eqwaitni = ni;
}
} else {
the_lnet.ln_eqwaitni = ni;
}
} else {
+# ifndef HAVE_LIBPTHREAD
LCONSOLE_ERROR("LND %s not supported in a "
"single-threaded runtime\n",
libcfs_lnd2str(lnd_type));
LCONSOLE_ERROR("LND %s not supported in a "
"single-threaded runtime\n",
libcfs_lnd2str(lnd_type));
# ifdef CRAY_XT3
LNET_REGISTER_ULND(the_ptllnd);
# endif
# ifdef CRAY_XT3
LNET_REGISTER_ULND(the_ptllnd);
# endif
LNET_REGISTER_ULND(the_tcplnd);
# endif
#endif
LNET_REGISTER_ULND(the_tcplnd);
# endif
#endif
#else
struct timeval then;
struct timeval now;
#else
struct timeval then;
struct timeval now;
struct timespec ts;
# endif
lnet_ni_t *eqwaitni = the_lnet.ln_eqwaitni;
struct timespec ts;
# endif
lnet_ni_t *eqwaitni = the_lnet.ln_eqwaitni;
+# ifndef HAVE_LIBPTHREAD
/* If I'm single-threaded, LNET fails at startup if it can't
* set the_lnet.ln_eqwaitni correctly. */
LBUG();
/* If I'm single-threaded, LNET fails at startup if it can't
* set the_lnet.ln_eqwaitni correctly. */
LBUG();
if (cfs_waitq_active(&the_lnet.ln_waitq))
cfs_waitq_broadcast(&the_lnet.ln_waitq);
#else
if (cfs_waitq_active(&the_lnet.ln_waitq))
cfs_waitq_broadcast(&the_lnet.ln_waitq);
#else
+# ifndef HAVE_LIBPTHREAD
/* LNetEQPoll() calls into _the_ LND to wait for action */
# else
/* Wake anyone waiting in LNetEQPoll() */
/* LNetEQPoll() calls into _the_ LND to wait for action */
# else
/* Wake anyone waiting in LNetEQPoll() */