diff options
author | Olivier Bertrand <bertrandop@gmail.com> | 2013-06-05 00:46:06 +0200 |
---|---|---|
committer | Olivier Bertrand <bertrandop@gmail.com> | 2013-06-05 00:46:06 +0200 |
commit | e227d50203d6e6c94ad5727155a2df80114cb4a5 (patch) | |
tree | 9533a7d833e2e87b74058789d515bed4550a853e /storage/connect/tabtbl.cpp | |
parent | 9df57eba9f7b9bbee19bba5e880cbf611ef82d5b (diff) | |
download | mariadb-git-e227d50203d6e6c94ad5727155a2df80114cb4a5.tar.gz |
- Change CRLF line endings to LF
modified:
storage/connect/tabtbl.cpp
storage/connect/tabtbl.h
Diffstat (limited to 'storage/connect/tabtbl.cpp')
-rw-r--r-- | storage/connect/tabtbl.cpp | 90 |
1 files changed, 45 insertions, 45 deletions
diff --git a/storage/connect/tabtbl.cpp b/storage/connect/tabtbl.cpp index 61f9c8628d9..89acc53fd4a 100644 --- a/storage/connect/tabtbl.cpp +++ b/storage/connect/tabtbl.cpp @@ -77,15 +77,15 @@ #include "ha_connect.h" #include "mycat.h" // For GetHandler -#if defined(WIN32)
-#if defined(__BORLANDC__)
-#define SYSEXIT void _USERENTRY
-#else
-#define SYSEXIT void
-#endif
-#else // !WIN32
-#define SYSEXIT void *
-#endif // !WIN32
+#if defined(WIN32) +#if defined(__BORLANDC__) +#define SYSEXIT void _USERENTRY +#else +#define SYSEXIT void +#endif +#else // !WIN32 +#define SYSEXIT void * +#endif // !WIN32 extern "C" int trace; @@ -515,40 +515,40 @@ void TBTBLK::ReadColumn(PGLOBAL g) /* ------------------------- Class TDBTBM ---------------------------- */ -/***********************************************************************/
-/* Thread routine that check and open one remote connection. */
-/***********************************************************************/
-pthread_handler_t ThreadOpen(void *p)
- {
- PTBMT cmp = (PTBMT)p;
-
- if (!my_thread_init()) {
+/***********************************************************************/ +/* Thread routine that check and open one remote connection. */ +/***********************************************************************/ +pthread_handler_t ThreadOpen(void *p) + { + PTBMT cmp = (PTBMT)p; + + if (!my_thread_init()) { set_current_thd(cmp->Thd); - // Try to open the connection
- if (!cmp->Tap->GetTo_Tdb()->OpenDB(cmp->G)) {
- cmp->Ready = true;
- } else
- cmp->Rc = RC_FX;
-
- my_thread_end();
- } else
- cmp->Rc = RC_FX;
-
- return NULL;
- } // end of ThreadOpen
-
+ // Try to open the connection + if (!cmp->Tap->GetTo_Tdb()->OpenDB(cmp->G)) { + cmp->Ready = true; + } else + cmp->Rc = RC_FX; + + my_thread_end(); + } else + cmp->Rc = RC_FX; + + return NULL; + } // end of ThreadOpen + /***********************************************************************/ /* TDBTBM constructors. */ /***********************************************************************/ TDBTBM::TDBTBM(PTBLDEF tdp) : TDBTBL(tdp) { - Tmp = NULL; // To data table TBMT structures
- Cmp = NULL; // Current data table TBMT
- Bmp = NULL; // To bad (unconnected) TBMT structures
- Done = false; // TRUE after first GetAllResults
- Nrc = 0; // Number of remote connections
- Nlc = 0; // Number of local connections
+ Tmp = NULL; // To data table TBMT structures + Cmp = NULL; // Current data table TBMT + Bmp = NULL; // To bad (unconnected) TBMT structures + Done = false; // TRUE after first GetAllResults + Nrc = 0; // Number of remote connections + Nlc = 0; // Number of local connections } // end of TDBTBL standard constructor /***********************************************************************/ @@ -580,8 +580,8 @@ int TDBTBM::RowNumber(PGLOBAL g, bool b) /***********************************************************************/ bool TDBTBM::OpenTables(PGLOBAL g) { - int k;
- THD *thd = current_thd;
+ int k; + THD *thd = current_thd; PTABLE tabp, *ptabp = &Tablist; PTBMT tp, *ptp = &Tmp; @@ -598,16 +598,16 @@ bool TDBTBM::OpenTables(PGLOBAL g) tp->Tap = tabp; tp->Thd = thd; - // Create the thread that will do the table opening.
+ // Create the thread that will do the table opening. pthread_attr_init(&tp->attr); // pthread_attr_setdetachstate(&tp->attr, PTHREAD_CREATE_JOINABLE); - if ((k = pthread_create(&tp->Tid, &tp->attr, ThreadOpen, tp))) {
- sprintf(g->Message, "pthread_create error %d", k);
- Nbc++;
- continue;
- } // endif k
-
+ if ((k = pthread_create(&tp->Tid, &tp->attr, ThreadOpen, tp))) { + sprintf(g->Message, "pthread_create error %d", k); + Nbc++; + continue; + } // endif k + // Add it to the remote list *ptp = tp; ptp = &tp->Next; |