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 #include "primpl.h" | 6 #include "primpl.h" |
7 | 7 |
8 #if defined(WIN95) | 8 #if defined(WIN95) |
9 /* | 9 /* |
10 ** Some local variables report warnings on Win95 because the code paths | 10 ** Some local variables report warnings on Win95 because the code paths |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 { | 190 { |
191 PRThread *me = _PR_MD_CURRENT_THREAD(); | 191 PRThread *me = _PR_MD_CURRENT_THREAD(); |
192 PRIntn is; | 192 PRIntn is; |
193 PRThread *t; | 193 PRThread *t; |
194 PRCList *q; | 194 PRCList *q; |
195 | 195 |
196 PR_ASSERT(me != suspendAllThread); | 196 PR_ASSERT(me != suspendAllThread); |
197 PR_ASSERT(!(me->flags & _PR_IDLE_THREAD)); | 197 PR_ASSERT(!(me->flags & _PR_IDLE_THREAD)); |
198 PR_ASSERT(lock != NULL); | 198 PR_ASSERT(lock != NULL); |
199 #ifdef _PR_GLOBAL_THREADS_ONLY | 199 #ifdef _PR_GLOBAL_THREADS_ONLY |
200 PR_ASSERT(lock->owner != me); | |
201 _PR_MD_LOCK(&lock->ilock); | 200 _PR_MD_LOCK(&lock->ilock); |
| 201 PR_ASSERT(lock->owner == 0); |
202 lock->owner = me; | 202 lock->owner = me; |
203 return; | 203 return; |
204 #else /* _PR_GLOBAL_THREADS_ONLY */ | 204 #else /* _PR_GLOBAL_THREADS_ONLY */ |
205 | 205 |
206 if (_native_threads_only) { | 206 if (_native_threads_only) { |
207 PR_ASSERT(lock->owner != me); | |
208 _PR_MD_LOCK(&lock->ilock); | 207 _PR_MD_LOCK(&lock->ilock); |
| 208 PR_ASSERT(lock->owner == 0); |
209 lock->owner = me; | 209 lock->owner = me; |
210 return; | 210 return; |
211 } | 211 } |
212 | 212 |
213 if (!_PR_IS_NATIVE_THREAD(me)) | 213 if (!_PR_IS_NATIVE_THREAD(me)) |
214 _PR_INTSOFF(is); | 214 _PR_INTSOFF(is); |
215 | 215 |
216 PR_ASSERT(_PR_IS_NATIVE_THREAD(me) || _PR_MD_GET_INTSOFF() != 0); | 216 PR_ASSERT(_PR_IS_NATIVE_THREAD(me) || _PR_MD_GET_INTSOFF() != 0); |
217 | 217 |
218 retry: | 218 retry: |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
424 #endif /* _PR_GLOBAL_THREADS_ONLY */ | 424 #endif /* _PR_GLOBAL_THREADS_ONLY */ |
425 } | 425 } |
426 | 426 |
427 /************************************************************************/ | 427 /************************************************************************/ |
428 /************************************************************************/ | 428 /************************************************************************/ |
429 /***********************ROUTINES FOR DCE EMULATION***********************/ | 429 /***********************ROUTINES FOR DCE EMULATION***********************/ |
430 /************************************************************************/ | 430 /************************************************************************/ |
431 /************************************************************************/ | 431 /************************************************************************/ |
432 PR_IMPLEMENT(PRStatus) PRP_TryLock(PRLock *lock) | 432 PR_IMPLEMENT(PRStatus) PRP_TryLock(PRLock *lock) |
433 { return (PR_TestAndLock(lock)) ? PR_SUCCESS : PR_FAILURE; } | 433 { return (PR_TestAndLock(lock)) ? PR_SUCCESS : PR_FAILURE; } |
OLD | NEW |