OLD | NEW |
1 /* This Source Code Form is subject to the terms of the Mozilla Public | 1 /* This Source Code Form is subject to the terms of the Mozilla Public |
2 * License, v. 2.0. If a copy of the MPL was not distributed with this | 2 * License, v. 2.0. If a copy of the MPL was not distributed with this |
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
4 | 4 |
5 #include "nssrwlk.h" | 5 #include "nssrwlk.h" |
6 #include "nspr.h" | 6 #include "nspr.h" |
7 | 7 |
8 PR_BEGIN_EXTERN_C | 8 PR_BEGIN_EXTERN_C |
9 | 9 |
10 /* | 10 /* |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 } | 84 } |
85 rwlock->rw_reader_waitq = PZ_NewCondVar(rwlock->rw_lock); | 85 rwlock->rw_reader_waitq = PZ_NewCondVar(rwlock->rw_lock); |
86 if (rwlock->rw_reader_waitq == NULL) { | 86 if (rwlock->rw_reader_waitq == NULL) { |
87 goto loser; | 87 goto loser; |
88 } | 88 } |
89 rwlock->rw_writer_waitq = PZ_NewCondVar(rwlock->rw_lock); | 89 rwlock->rw_writer_waitq = PZ_NewCondVar(rwlock->rw_lock); |
90 if (rwlock->rw_writer_waitq == NULL) { | 90 if (rwlock->rw_writer_waitq == NULL) { |
91 goto loser; | 91 goto loser; |
92 } | 92 } |
93 if (lock_name != NULL) { | 93 if (lock_name != NULL) { |
94 rwlock->rw_name = (char*) PR_Malloc(strlen(lock_name) + 1); | 94 rwlock->rw_name = (char*) PR_Malloc((PRUint32)strlen(lock_name) + 1); |
95 if (rwlock->rw_name == NULL) { | 95 if (rwlock->rw_name == NULL) { |
96 goto loser; | 96 goto loser; |
97 } | 97 } |
98 strcpy(rwlock->rw_name, lock_name); | 98 strcpy(rwlock->rw_name, lock_name); |
99 } else { | 99 } else { |
100 rwlock->rw_name = NULL; | 100 rwlock->rw_name = NULL; |
101 } | 101 } |
102 rwlock->rw_rank = lock_rank; | 102 rwlock->rw_rank = lock_rank; |
103 rwlock->rw_waiting_readers = 0; | 103 rwlock->rw_waiting_readers = 0; |
104 rwlock->rw_waiting_writers = 0; | 104 rwlock->rw_waiting_writers = 0; |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
438 break; | 438 break; |
439 } | 439 } |
440 /* | 440 /* |
441 * set top of stack to highest numbered empty slot | 441 * set top of stack to highest numbered empty slot |
442 */ | 442 */ |
443 lock_stack->trs_index = new_index; | 443 lock_stack->trs_index = new_index; |
444 | 444 |
445 } | 445 } |
446 | 446 |
447 #endif /* NSS_RWLOCK_RANK_ORDER_DEBUG */ | 447 #endif /* NSS_RWLOCK_RANK_ORDER_DEBUG */ |
OLD | NEW |