Commit 4734f3f7 authored by unknown's avatar unknown
Browse files

Merge tulin@bk-internal.mysql.com:/home/bk/mysql-4.1

into mysql.com:/home/mysqldev/tulin/mysql-4.1

parents f2296958 e7ff7469
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -1624,6 +1624,11 @@ AC_DEFUN([MYSQL_CHECK_NDB_OPTIONS], [
  --without-ndb-debug   Disable special ndb debug features],
              [ndb_debug="$withval"],
              [ndb_debug="default"])
  AC_ARG_WITH([ndb-ccflags],
              [
  --with-ndb-ccflags    Extra CC options for ndb compile],
              [ndb_cxxflags_fix="$ndb_cxxflags_fix $withval"],
              [ndb_cxxflags_fix=$ndb_cxxflags_fix])

  AC_MSG_CHECKING([for NDB Cluster options])
  AC_MSG_RESULT([])
+6 −0
Original line number Diff line number Diff line
@@ -135,7 +135,13 @@
#ifdef HAVE_UNIXWARE7_THREADS
#include <thread.h>
#else
#if defined(HPUX10) || defined(HPUX11)
C_MODE_START			/* HPUX needs this, signal.h bug */
#include <pthread.h>
C_MODE_END
#else
#include <pthread.h>		/* AIX must have this included first */
#endif
#endif /* HAVE_UNIXWARE7_THREADS */
#endif /* HAVE_mit_thread */
#if !defined(SCO) && !defined(_REENTRANT)
+1 −1
Original line number Diff line number Diff line
@@ -76,7 +76,7 @@ int NdbThread_WaitFor(struct NdbThread* p_wait_thread, void** status);
 *   
 * *  status: exit code
 */
void NdbThread_Exit(int status);
void NdbThread_Exit(void *status);

/**
 * Set thread concurrency level
+4 −12
Original line number Diff line number Diff line
@@ -54,10 +54,7 @@ extern "C" void* thread1func(void* arg)
  if (arg1 != 7)
    fail("TEST1", "Wrong arg");

  NdbThread_Exit(returnvalue);

  return NULL;
  
  return returnvalue;
}

// test 2 variables and funcs
@@ -80,10 +77,7 @@ extern "C" void* test2func(void* arg)
    fail("TEST2", "Failed to unlock mutex");

  int returnvalue = arg1;
  NdbThread_Exit(returnvalue);

  return NULL;
  
  return returnvalue;
}


@@ -129,8 +123,7 @@ extern "C" void* testfunc(void* arg)
    }
  while(tmpVar<100);
  
  NdbThread_Exit(0);
  return NULL;
  return 0;
}

extern "C" void* testTryLockfunc(void* arg)
@@ -169,8 +162,7 @@ extern "C" void* testTryLockfunc(void* arg)
    }
  while(tmpVar<100);
  
  NdbThread_Exit(0);
  return NULL;
  return 0;
}


+24 −16
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@

#include <ndb_global.h>
#include <NdbThread.h>
#include <pthread.h>
#include <my_pthread.h>
#include <NdbMem.h>

#define MAX_THREAD_NAME 16
@@ -39,8 +39,8 @@ struct NdbThread
static
void*
ndb_thread_wrapper(void* _ss){
  void * ret;
  struct NdbThread * ss = (struct NdbThread *)_ss;
  my_thread_init();
  {
    DBUG_ENTER("ndb_thread_wrapper");
#ifdef NDB_SHM_TRANSPORTER
    if (g_ndb_shm_signum)
@@ -52,8 +52,15 @@ ndb_thread_wrapper(void* _ss){
      pthread_sigmask(SIG_BLOCK, &mask, 0);
    }
#endif
    {
      void *ret;
      struct NdbThread * ss = (struct NdbThread *)_ss;
      ret= (* ss->func)(ss->object);
  DBUG_RETURN(ret);
      NdbThread_Exit(ret);
    }
  /* will never be reached */
    DBUG_RETURN(0);
  }
}


@@ -130,9 +137,10 @@ int NdbThread_WaitFor(struct NdbThread* p_wait_thread, void** status)
}


void NdbThread_Exit(int status)
void NdbThread_Exit(void *status)
{
  pthread_exit(&status);
  my_thread_end();
  pthread_exit(status);
}


Loading