diff options
author | unknown <tomas@poseidon.ndb.mysql.com> | 2004-10-25 16:02:41 +0000 |
---|---|---|
committer | unknown <tomas@poseidon.ndb.mysql.com> | 2004-10-25 16:02:41 +0000 |
commit | e60ea455e3aaa07f6a79340a8ef8ff4768e47429 (patch) | |
tree | b0b9e8a1c6c328f5ce4a98e35e036d6b46753acb /ndb | |
parent | 7e39126de87538ab4d819f4a40b1f85eee4b73de (diff) | |
download | mariadb-git-e60ea455e3aaa07f6a79340a8ef8ff4768e47429.tar.gz |
removed usage od NDB_MUTEX_INITIALIZER
Diffstat (limited to 'ndb')
-rw-r--r-- | ndb/test/ndbapi/testDeadlock.cpp | 8 | ||||
-rw-r--r-- | ndb/test/ndbapi/testOIBasic.cpp | 8 |
2 files changed, 10 insertions, 6 deletions
diff --git a/ndb/test/ndbapi/testDeadlock.cpp b/ndb/test/ndbapi/testDeadlock.cpp index a445823b8a8..66fa48173cc 100644 --- a/ndb/test/ndbapi/testDeadlock.cpp +++ b/ndb/test/ndbapi/testDeadlock.cpp @@ -48,14 +48,14 @@ printusage() static Opt g_opt; -static NdbMutex ndbout_mutex = NDB_MUTEX_INITIALIZER; +static NdbMutex *ndbout_mutex= NULL; #define DBG(x) \ do { \ if (! g_opt.m_dbg) break; \ - NdbMutex_Lock(&ndbout_mutex); \ + NdbMutex_Lock(ndbout_mutex); \ ndbout << "line " << __LINE__ << " " << x << endl; \ - NdbMutex_Unlock(&ndbout_mutex); \ + NdbMutex_Unlock(ndbout_mutex); \ } while (0) #define CHK(x) \ @@ -492,6 +492,8 @@ wl1822_main(char scantx) NDB_COMMAND(testOdbcDriver, "testDeadlock", "testDeadlock", "testDeadlock", 65535) { ndb_init(); + if (ndbout_mutex == NULL) + ndbout_mutex= NdbMutex_Create(); while (++argv, --argc > 0) { const char* arg = argv[0]; if (strcmp(arg, "-scan") == 0) { diff --git a/ndb/test/ndbapi/testOIBasic.cpp b/ndb/test/ndbapi/testOIBasic.cpp index 1c611d2b8ff..21862e02328 100644 --- a/ndb/test/ndbapi/testOIBasic.cpp +++ b/ndb/test/ndbapi/testOIBasic.cpp @@ -137,7 +137,7 @@ static const bool g_compare_null = true; // log and error macros -static NdbMutex ndbout_mutex = NDB_MUTEX_INITIALIZER; +static NdbMutex *ndbout_mutex= NULL; static unsigned getthrno(); @@ -160,9 +160,9 @@ getthrstr() #define LLN(n, s) \ do { \ if ((n) > g_opt.m_v) break; \ - if (g_opt.m_msglock) NdbMutex_Lock(&ndbout_mutex); \ + if (g_opt.m_msglock) NdbMutex_Lock(ndbout_mutex); \ ndbout << getthrstr() << s << endl; \ - if (g_opt.m_msglock) NdbMutex_Unlock(&ndbout_mutex); \ + if (g_opt.m_msglock) NdbMutex_Unlock(ndbout_mutex); \ } while(0) #define LL0(s) LLN(0, s) @@ -3349,6 +3349,8 @@ runtest(Par par) NDB_COMMAND(testOIBasic, "testOIBasic", "testOIBasic", "testOIBasic", 65535) { ndb_init(); + if (ndbout_mutex == NULL) + ndbout_mutex= NdbMutex_Create(); while (++argv, --argc > 0) { const char* arg = argv[0]; if (*arg != '-') { |