OLD | NEW |
1 /* ***** BEGIN LICENSE BLOCK ***** | 1 /* ***** BEGIN LICENSE BLOCK ***** |
2 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 | 2 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
3 * | 3 * |
4 * The contents of this file are subject to the Mozilla Public License Version | 4 * The contents of this file are subject to the Mozilla Public License Version |
5 * 1.1 (the "License"); you may not use this file except in compliance with | 5 * 1.1 (the "License"); you may not use this file except in compliance with |
6 * the License. You may obtain a copy of the License at | 6 * the License. You may obtain a copy of the License at |
7 * http://www.mozilla.org/MPL/ | 7 * http://www.mozilla.org/MPL/ |
8 * | 8 * |
9 * Software distributed under the License is distributed on an "AS IS" basis, | 9 * Software distributed under the License is distributed on an "AS IS" basis, |
10 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | 10 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License |
(...skipping 17 matching lines...) Expand all Loading... |
28 * under the terms of either the GPL or the LGPL, and not to allow others to | 28 * under the terms of either the GPL or the LGPL, and not to allow others to |
29 * use your version of this file under the terms of the MPL, indicate your | 29 * use your version of this file under the terms of the MPL, indicate your |
30 * decision by deleting the provisions above and replace them with the notice | 30 * decision by deleting the provisions above and replace them with the notice |
31 * and other provisions required by the GPL or the LGPL. If you do not delete | 31 * and other provisions required by the GPL or the LGPL. If you do not delete |
32 * the provisions above, a recipient may use your version of this file under | 32 * the provisions above, a recipient may use your version of this file under |
33 * the terms of any one of the MPL, the GPL or the LGPL. | 33 * the terms of any one of the MPL, the GPL or the LGPL. |
34 * | 34 * |
35 * ***** END LICENSE BLOCK ***** */ | 35 * ***** END LICENSE BLOCK ***** */ |
36 | 36 |
37 #ifdef DEBUG | 37 #ifdef DEBUG |
38 static const char CVS_ID[] = "@(#) $RCSfile: devslot.c,v $ $Revision: 1.26 $ $Da
te: 2010/01/08 02:00:58 $"; | 38 static const char CVS_ID[] = "@(#) $RCSfile: devslot.c,v $ $Revision: 1.27 $ $Da
te: 2010/04/03 18:27:30 $"; |
39 #endif /* DEBUG */ | 39 #endif /* DEBUG */ |
40 | 40 |
41 #include "pkcs11.h" | 41 #include "pkcs11.h" |
42 | 42 |
43 #ifndef DEVM_H | 43 #ifndef DEVM_H |
44 #include "devm.h" | 44 #include "devm.h" |
45 #endif /* DEVM_H */ | 45 #endif /* DEVM_H */ |
46 | 46 |
47 #ifndef CKHELPER_H | 47 #ifndef CKHELPER_H |
48 #include "ckhelper.h" | 48 #include "ckhelper.h" |
(...skipping 14 matching lines...) Expand all Loading... |
63 | 63 |
64 /* The flags needed to open a read-only session. */ | 64 /* The flags needed to open a read-only session. */ |
65 static const CK_FLAGS s_ck_readonly_flags = CKF_SERIAL_SESSION; | 65 static const CK_FLAGS s_ck_readonly_flags = CKF_SERIAL_SESSION; |
66 | 66 |
67 NSS_IMPLEMENT PRStatus | 67 NSS_IMPLEMENT PRStatus |
68 nssSlot_Destroy ( | 68 nssSlot_Destroy ( |
69 NSSSlot *slot | 69 NSSSlot *slot |
70 ) | 70 ) |
71 { | 71 { |
72 if (slot) { | 72 if (slot) { |
73 » if (PR_AtomicDecrement(&slot->base.refCount) == 0) { | 73 » if (PR_ATOMIC_DECREMENT(&slot->base.refCount) == 0) { |
74 PZ_DestroyLock(slot->base.lock); | 74 PZ_DestroyLock(slot->base.lock); |
75 return nssArena_Destroy(slot->base.arena); | 75 return nssArena_Destroy(slot->base.arena); |
76 } | 76 } |
77 } | 77 } |
78 return PR_SUCCESS; | 78 return PR_SUCCESS; |
79 } | 79 } |
80 | 80 |
81 void | 81 void |
82 nssSlot_EnterMonitor(NSSSlot *slot) | 82 nssSlot_EnterMonitor(NSSSlot *slot) |
83 { | 83 { |
(...skipping 16 matching lines...) Expand all Loading... |
100 ) | 100 ) |
101 { | 101 { |
102 (void)nssSlot_Destroy(slot); | 102 (void)nssSlot_Destroy(slot); |
103 } | 103 } |
104 | 104 |
105 NSS_IMPLEMENT NSSSlot * | 105 NSS_IMPLEMENT NSSSlot * |
106 nssSlot_AddRef ( | 106 nssSlot_AddRef ( |
107 NSSSlot *slot | 107 NSSSlot *slot |
108 ) | 108 ) |
109 { | 109 { |
110 PR_AtomicIncrement(&slot->base.refCount); | 110 PR_ATOMIC_INCREMENT(&slot->base.refCount); |
111 return slot; | 111 return slot; |
112 } | 112 } |
113 | 113 |
114 NSS_IMPLEMENT NSSUTF8 * | 114 NSS_IMPLEMENT NSSUTF8 * |
115 nssSlot_GetName ( | 115 nssSlot_GetName ( |
116 NSSSlot *slot | 116 NSSSlot *slot |
117 ) | 117 ) |
118 { | 118 { |
119 return slot->base.name; | 119 return slot->base.name; |
120 } | 120 } |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 } | 287 } |
288 | 288 |
289 NSS_EXTERN PRBool | 289 NSS_EXTERN PRBool |
290 nssSession_IsReadWrite ( | 290 nssSession_IsReadWrite ( |
291 nssSession *s | 291 nssSession *s |
292 ) | 292 ) |
293 { | 293 { |
294 return s->isRW; | 294 return s->isRW; |
295 } | 295 } |
296 | 296 |
OLD | NEW |