2723 Kevin Lewis 2008-06-30
Cleanup code and change CRLF to LF
modified:
storage/falcon/SerialLog.cpp
storage/falcon/SyncTest.cpp
storage/falcon/SyncTest.h
2722 Kevin Lewis 2008-06-30
Bug#37587 - Release SerialLogTransaction::pending.syncObject just before
waiting for SerialLog::syncSerializeGophers instead of just after that.
This avoids a 3 way deadlock
modified:
storage/falcon/Gopher.cpp
=== modified file 'storage/falcon/Gopher.cpp'
--- a/storage/falcon/Gopher.cpp 2008-06-17 17:41:54 +0000
+++ b/storage/falcon/Gopher.cpp 2008-06-30 16:51:55 +0000
@@ -64,16 +64,14 @@ void Gopher::gopherThread(void)
SerialLogTransaction *transaction = log->pending.first;
log->pending.remove(transaction);
-
- Sync serializeGophers(&log->syncSerializeGophers, "Gopher::gopherThread(4)");
+ sync.unlock();
+ Sync serializeGophers(&log->syncSerializeGophers, "Gopher::gopherThread(4)");
if (transaction->allowConcurrentGophers)
serializeGophers.lock(Shared);
else
serializeGophers.lock(Exclusive);
- sync.unlock();
-
transaction->doAction();
sync.lock(Exclusive);
=== modified file 'storage/falcon/SerialLog.cpp'
--- a/storage/falcon/SerialLog.cpp 2008-06-23 10:22:43 +0000
+++ b/storage/falcon/SerialLog.cpp 2008-06-30 16:58:45 +0000
@@ -610,8 +610,6 @@ void SerialLog::createNewWindow(void)
file->truncate((int64)falcon_serial_log_file_size);
}
-
-
writeWindow->deactivateWindow();
writeWindow = allocWindow(file, fileOffset);
writeWindow->firstBlockNumber = nextBlockNumber;
@@ -849,7 +847,7 @@ SerialLogTransaction* SerialLog::getTran
if (transaction)
return transaction;
- Sync sync (&pending.syncObject, "SerialLog::findTransaction");
+ Sync sync (&pending.syncObject, "SerialLog::getTransaction");
sync.lock(Exclusive);
/***
=== modified file 'storage/falcon/SyncTest.cpp'
--- a/storage/falcon/SyncTest.cpp 2008-06-12 16:43:53 +0000
+++ b/storage/falcon/SyncTest.cpp 2008-06-30 16:58:45 +0000
@@ -127,40 +127,40 @@ void SyncTest::testThread(void)
sync.unlock();
}
}
-
-JString SyncTest::format(long num)
-{
- char temp[32];
- long number = num;
- char *p = temp + sizeof(temp);
- *--p = 0;
-
- if (number == 0)
- {
- *--p = '0';
-
- return p;
- }
-
- bool neg = false;
-
- if (number < 0)
- {
- neg = true;
- number = -number;
- }
-
- for (int n = 1; number; ++n)
- {
- *--p = (char) (number % 10) + '0';
- number /= 10;
-
- if (number && (n % 3 == 0))
- *--p = ',';
- }
-
- if (neg)
- *--p = '-';
-
- return JString(p);
-}
+
+JString SyncTest::format(long num)
+{
+ char temp[32];
+ long number = num;
+ char *p = temp + sizeof(temp);
+ *--p = 0;
+
+ if (number == 0)
+ {
+ *--p = '0';
+
+ return p;
+ }
+
+ bool neg = false;
+
+ if (number < 0)
+ {
+ neg = true;
+ number = -number;
+ }
+
+ for (int n = 1; number; ++n)
+ {
+ *--p = (char) (number % 10) + '0';
+ number /= 10;
+
+ if (number && (n % 3 == 0))
+ *--p = ',';
+ }
+
+ if (neg)
+ *--p = '-';
+
+ return JString(p);
+}
=== modified file 'storage/falcon/SyncTest.h'
--- a/storage/falcon/SyncTest.h 2008-06-12 16:43:53 +0000
+++ b/storage/falcon/SyncTest.h 2008-06-30 16:58:45 +0000
@@ -32,7 +32,7 @@ public:
static void testThread(void* parameter);
void test();
void testThread(void);
- JString format(long number);
+ JString format(long number);
bool stop;
bool ready;
| Thread |
|---|
| • bzr push into mysql-6.0-falcon branch (klewis:2722 to 2723) Bug#37587 | Kevin Lewis | 30 Jun |