| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 FileThread* fileThread = static_cast<FileThread*>(arg); | 88 FileThread* fileThread = static_cast<FileThread*>(arg); |
| 89 fileThread->runLoop(); | 89 fileThread->runLoop(); |
| 90 } | 90 } |
| 91 | 91 |
| 92 void FileThread::runLoop() | 92 void FileThread::runLoop() |
| 93 { | 93 { |
| 94 { | 94 { |
| 95 // Wait for FileThread::start() to complete to have m_threadID | 95 // Wait for FileThread::start() to complete to have m_threadID |
| 96 // established before starting the main loop. | 96 // established before starting the main loop. |
| 97 MutexLocker lock(m_threadCreationMutex); | 97 MutexLocker lock(m_threadCreationMutex); |
| 98 LOG(FileAPI, "Started FileThread %p", this); | 98 LOG_INFO(FileAPI, "Started FileThread %p", this); |
| 99 } | 99 } |
| 100 | 100 |
| 101 AutodrainedPool pool; | 101 AutodrainedPool pool; |
| 102 while (OwnPtr<Task> task = m_queue.waitForMessage()) { | 102 while (OwnPtr<Task> task = m_queue.waitForMessage()) { |
| 103 task->performTask(); | 103 task->performTask(); |
| 104 pool.cycle(); | 104 pool.cycle(); |
| 105 } | 105 } |
| 106 | 106 |
| 107 LOG(FileAPI, "About to detach thread %i and clear the ref to FileThread %p,
which currently has %i ref(s)", m_threadID, this, refCount()); | 107 LOG_INFO(FileAPI, "About to detach thread %i and clear the ref to FileThread
%p, which currently has %i ref(s)", m_threadID, this, refCount()); |
| 108 | 108 |
| 109 detachThread(m_threadID); | 109 detachThread(m_threadID); |
| 110 | 110 |
| 111 // Clear the self refptr, possibly resulting in deletion | 111 // Clear the self refptr, possibly resulting in deletion |
| 112 m_selfRef = 0; | 112 m_selfRef = 0; |
| 113 } | 113 } |
| 114 | 114 |
| 115 } // namespace WebCore | 115 } // namespace WebCore |
| 116 | 116 |
| 117 #endif // ENABLE(BLOB) | 117 #endif // ENABLE(BLOB) |
| OLD | NEW |