Below is the list of changes that have just been committed into a local
6.0 repository of . When does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2007-10-23 13:45:26-04:00, jas@rowvwade. +2 -0
Make I/O system shutdown more reliable.
storage/falcon/Cache.cpp@stripped, 2007-10-23 13:45:19-04:00, jas@rowvwade. +21 -21
Make I/O system shutdown more reliable.
storage/falcon/Cache.h@stripped, 2007-10-23 13:45:19-04:00, jas@rowvwade. +2 -0
Make I/O system shutdown more reliable.
diff -Nrup a/storage/falcon/Cache.cpp b/storage/falcon/Cache.cpp
--- a/storage/falcon/Cache.cpp 2007-10-18 15:38:42 -04:00
+++ b/storage/falcon/Cache.cpp 2007-10-23 13:45:19 -04:00
@@ -807,21 +807,6 @@ void Cache::setPageWriter(PageWriter *wr
pageWriter = writer;
}
-void Cache::shutdownNow(void)
-{
- panicShutdown = true;
- Sync sync (&syncDirty, "Cache::shutdownNow");
- sync.lock (Exclusive);
-
- for (Bdb *bdb = firstDirty; bdb; bdb = bdb->nextDirty)
- {
- Dbb *database = bdb->dbb;
- database->writePage (bdb, WRITE_TYPE_SHUTDOWN);
- }
-
-
-}
-
void Cache::validateCache(void)
{
//MemMgrValidate(bufferSpace);
@@ -882,6 +867,8 @@ void Cache::ioThread(void* arg)
void Cache::ioThread(void)
{
+ Sync syncThread(&syncThreads, "Cache::ioThread");
+ syncThread.lock(Shared);
Sync flushLock(&syncFlush, "Cache::ioThread");
Sync sync(&syncObject, "Cache::ioThread");
Thread *thread = Thread::getThread("Cache::ioThread");
@@ -1042,15 +1029,28 @@ void Cache::ioThread(void)
void Cache::shutdown(void)
{
- for (int n = 0; n < numberIoThreads; ++n)
- {
- ioThreads[n]->shutdown();
- ioThreads[n] = 0;
- }
-
+ shutdownThreads();
Sync sync (&syncDirty, "Cache::shutdown");
sync.lock (Exclusive);
for (Bdb *bdb = firstDirty; bdb; bdb = bdb->nextDirty)
bdb->dbb->writePage(bdb, WRITE_TYPE_SHUTDOWN);
+}
+
+void Cache::shutdownNow(void)
+{
+ panicShutdown = true;
+ shutdown();
+}
+
+void Cache::shutdownThreads(void)
+{
+ for (int n = 0; n < numberIoThreads; ++n)
+ {
+ ioThreads[n]->shutdown();
+ ioThreads[n] = 0;
+ }
+
+ Sync sync(&syncThreads, "Cache::shutdownThreads");
+ sync.lock(Exclusive);
}
diff -Nrup a/storage/falcon/Cache.h b/storage/falcon/Cache.h
--- a/storage/falcon/Cache.h 2007-10-18 10:17:16 -04:00
+++ b/storage/falcon/Cache.h 2007-10-23 13:45:19 -04:00
@@ -61,6 +61,7 @@ public:
void validateCache(void);
void syncFile(Dbb *dbb, const char *text);
void ioThread(void);
+ void shutdownThreads(void);
static void ioThread(void* arg);
@@ -100,6 +101,7 @@ protected:
Thread **ioThreads;
SyncObject syncFlush;
SyncObject syncDirty;
+ SyncObject syncThreads;
PagePrecedence *freePrecedence;
time_t flushStart;
int flushPages;
| Thread |
|---|
| • bk commit into 6.0 tree (jas:1.2673) | U-ROWVWADEjas | 23 Oct |