| OLD | NEW |
| 1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ | 1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
| 2 /* This Source Code Form is subject to the terms of the Mozilla Public | 2 /* This Source Code Form is subject to the terms of the Mozilla Public |
| 3 * License, v. 2.0. If a copy of the MPL was not distributed with this | 3 * License, v. 2.0. If a copy of the MPL was not distributed with this |
| 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
| 5 | 5 |
| 6 /* Windows 95 IO module | 6 /* Windows 95 IO module |
| 7 * | 7 * |
| 8 * Assumes synchronous I/O. | 8 * Assumes synchronous I/O. |
| 9 * | 9 * |
| 10 */ | 10 */ |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 { | 83 { |
| 84 DWORD rv; | 84 DWORD rv; |
| 85 | 85 |
| 86 PRUint32 msecs = (ticks == PR_INTERVAL_NO_TIMEOUT) ? | 86 PRUint32 msecs = (ticks == PR_INTERVAL_NO_TIMEOUT) ? |
| 87 INFINITE : PR_IntervalToMilliseconds(ticks); | 87 INFINITE : PR_IntervalToMilliseconds(ticks); |
| 88 rv = WaitForSingleObject(thread->md.blocked_sema, msecs); | 88 rv = WaitForSingleObject(thread->md.blocked_sema, msecs); |
| 89 switch(rv) | 89 switch(rv) |
| 90 { | 90 { |
| 91 case WAIT_OBJECT_0: | 91 case WAIT_OBJECT_0: |
| 92 return PR_SUCCESS; | 92 return PR_SUCCESS; |
| 93 break; | |
| 94 case WAIT_TIMEOUT: | 93 case WAIT_TIMEOUT: |
| 95 _PR_THREAD_LOCK(thread); | 94 _PR_THREAD_LOCK(thread); |
| 96 if (thread->state == _PR_IO_WAIT) { | 95 if (thread->state == _PR_IO_WAIT) { |
| 97 ; | 96 ; |
| 98 } else { | 97 } else { |
| 99 if (thread->wait.cvar != NULL) { | 98 if (thread->wait.cvar != NULL) { |
| 100 thread->wait.cvar = NULL; | 99 thread->wait.cvar = NULL; |
| 101 _PR_THREAD_UNLOCK(thread); | 100 _PR_THREAD_UNLOCK(thread); |
| 102 } else { | 101 } else { |
| 103 /* The CVAR was notified just as the timeout | 102 /* The CVAR was notified just as the timeout |
| 104 * occurred. This led to us being notified twice. | 103 * occurred. This led to us being notified twice. |
| 105 * call WaitForSingleObject() to clear the semaphore. | 104 * call WaitForSingleObject() to clear the semaphore. |
| 106 */ | 105 */ |
| 107 _PR_THREAD_UNLOCK(thread); | 106 _PR_THREAD_UNLOCK(thread); |
| 108 rv = WaitForSingleObject(thread->md.blocked_sema, 0); | 107 rv = WaitForSingleObject(thread->md.blocked_sema, 0); |
| 109 PR_ASSERT(rv == WAIT_OBJECT_0); | 108 PR_ASSERT(rv == WAIT_OBJECT_0); |
| 110 } | 109 } |
| 111 } | 110 } |
| 112 return PR_SUCCESS; | 111 return PR_SUCCESS; |
| 113 break; | |
| 114 default: | 112 default: |
| 115 return PR_FAILURE; | 113 return PR_FAILURE; |
| 116 break; | |
| 117 } | 114 } |
| 118 } | 115 } |
| 119 PRStatus | 116 PRStatus |
| 120 _PR_MD_WAKEUP_WAITER(PRThread *thread) | 117 _PR_MD_WAKEUP_WAITER(PRThread *thread) |
| 121 { | 118 { |
| 122 if ( _PR_IS_NATIVE_THREAD(thread) ) | 119 if ( _PR_IS_NATIVE_THREAD(thread) ) |
| 123 { | 120 { |
| 124 if (ReleaseSemaphore(thread->md.blocked_sema, 1, NULL) == FALSE) | 121 if (ReleaseSemaphore(thread->md.blocked_sema, 1, NULL) == FALSE) |
| 125 return PR_FAILURE; | 122 return PR_FAILURE; |
| 126 else | 123 else |
| (...skipping 1239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1366 info->creationTime = info->modifyTime; | 1363 info->creationTime = info->modifyTime; |
| 1367 } else { | 1364 } else { |
| 1368 _PR_FileTimeToPRTime(&findFileData.ftCreationTime, | 1365 _PR_FileTimeToPRTime(&findFileData.ftCreationTime, |
| 1369 &info->creationTime); | 1366 &info->creationTime); |
| 1370 } | 1367 } |
| 1371 | 1368 |
| 1372 return 0; | 1369 return 0; |
| 1373 } | 1370 } |
| 1374 /* ================ end of UTF16 Interfaces ================================ */ | 1371 /* ================ end of UTF16 Interfaces ================================ */ |
| 1375 #endif /* MOZ_UNICODE */ | 1372 #endif /* MOZ_UNICODE */ |
| OLD | NEW |