Changeset 4591
- Timestamp:
- 11/05/08 17:12:54 (2 months ago)
- Files:
-
- trunk/src/charon/credentials/credential_manager.c (modified) (21 diffs)
- trunk/src/charon/credentials/sets/cert_cache.c (modified) (12 diffs)
- trunk/src/charon/plugins/nm/nm_creds.c (modified) (13 diffs)
- trunk/src/charon/plugins/stroke/stroke_ca.c (modified) (13 diffs)
- trunk/src/charon/plugins/stroke/stroke_cred.c (modified) (18 diffs)
- trunk/src/libstrongswan/fetcher/fetcher_manager.c (modified) (9 diffs)
- trunk/src/libstrongswan/utils/mutex.c (modified) (4 diffs)
- trunk/src/libstrongswan/utils/mutex.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/charon/credentials/credential_manager.c
r4317 r4591 16 16 */ 17 17 18 /* some clibs need it for rwlocks */19 #define _GNU_SOURCE20 18 #include <pthread.h> 21 19 … … 23 21 24 22 #include <daemon.h> 23 #include <utils/mutex.h> 25 24 #include <utils/linked_list.h> 26 25 #include <credentials/sets/cert_cache.h> … … 69 68 * read-write lock to sets list 70 69 */ 71 pthread_rwlock_tlock;70 rwlock_t *lock; 72 71 }; 73 72 … … 171 170 static void destroy_cert_data(cert_data_t *data) 172 171 { 173 pthread_rwlock_unlock(&data->this->lock);172 data->this->lock->unlock(data->this->lock); 174 173 free(data); 175 174 } … … 198 197 data->trusted = trusted; 199 198 200 pthread_rwlock_rdlock(&this->lock);199 this->lock->read_lock(this->lock); 201 200 return enumerator_create_nested(create_sets_enumerator(this), 202 201 (void*)create_cert, data, … … 230 229 static void destroy_cdp_data(cdp_data_t *data) 231 230 { 232 pthread_rwlock_unlock(&data->this->lock);231 data->this->lock->unlock(data->this->lock); 233 232 free(data); 234 233 } … … 252 251 data->id = id; 253 252 254 pthread_rwlock_rdlock(&this->lock);253 this->lock->read_lock(this->lock); 255 254 return enumerator_create_nested(create_sets_enumerator(this), 256 255 (void*)create_cdp, data, … … 263 262 static void destroy_private_data(private_data_t *data) 264 263 { 265 pthread_rwlock_unlock(&data->this->lock);264 data->this->lock->unlock(data->this->lock); 266 265 free(data); 267 266 } … … 288 287 data->type = key; 289 288 data->keyid = keyid; 290 pthread_rwlock_rdlock(&this->lock);289 this->lock->read_lock(this->lock); 291 290 return enumerator_create_nested(create_sets_enumerator(this), 292 291 (void*)create_private, data, … … 317 316 static void destroy_shared_data(shared_data_t *data) 318 317 { 319 pthread_rwlock_unlock(&data->this->lock);318 data->this->lock->unlock(data->this->lock); 320 319 free(data); 321 320 } … … 342 341 data->other = other; 343 342 344 pthread_rwlock_rdlock(&this->lock);343 this->lock->read_lock(this->lock); 345 344 return enumerator_create_nested(create_sets_enumerator(this), 346 345 (void*)create_shared, data, … … 413 412 enumerator_t *enumerator; 414 413 415 if ( pthread_rwlock_trywrlock(&this->lock) == 0)414 if (this->lock->try_write_lock(this->lock)) 416 415 { 417 416 enumerator = this->sets->create_enumerator(this->sets); … … 424 423 else 425 424 { /* we can't cache now as other threads are active, queue for later */ 426 pthread_rwlock_rdlock(&this->lock);425 this->lock->read_lock(this->lock); 427 426 this->cache_queue->insert_last(this->cache_queue, cert->get_ref(cert)); 428 427 } 429 pthread_rwlock_unlock(&this->lock);428 this->lock->unlock(this->lock); 430 429 } 431 430 … … 440 439 441 440 if (this->cache_queue->get_count(this->cache_queue) > 0 && 442 pthread_rwlock_trywrlock(&this->lock) == 0)441 this->lock->try_write_lock(this->lock)) 443 442 { 444 443 while (this->cache_queue->remove_last(this->cache_queue, … … 453 452 cert->destroy(cert); 454 453 } 455 pthread_rwlock_unlock(&this->lock);454 this->lock->unlock(this->lock); 456 455 } 457 456 } … … 1303 1302 this->wrapper->destroy(this->wrapper); 1304 1303 } 1305 pthread_rwlock_unlock(&this->this->lock);1304 this->this->lock->unlock(this->this->lock); 1306 1305 1307 1306 /* check for delayed certificate cache queue */ … … 1329 1328 add_local_set(this, &enumerator->wrapper->set); 1330 1329 } 1331 pthread_rwlock_rdlock(&this->lock);1330 this->lock->read_lock(this->lock); 1332 1331 return &enumerator->public; 1333 1332 } … … 1526 1525 credential_set_t *set) 1527 1526 { 1528 pthread_rwlock_wrlock(&this->lock);1527 this->lock->write_lock(this->lock); 1529 1528 this->sets->insert_last(this->sets, set); 1530 pthread_rwlock_unlock(&this->lock);1529 this->lock->unlock(this->lock); 1531 1530 } 1532 1531 … … 1536 1535 static void remove_set(private_credential_manager_t *this, credential_set_t *set) 1537 1536 { 1538 pthread_rwlock_wrlock(&this->lock);1537 this->lock->write_lock(this->lock); 1539 1538 this->sets->remove(this->sets, set, NULL); 1540 pthread_rwlock_unlock(&this->lock);1539 this->lock->unlock(this->lock); 1541 1540 } 1542 1541 … … 1552 1551 pthread_key_delete(this->local_sets); 1553 1552 this->cache->destroy(this->cache); 1554 pthread_rwlock_destroy(&this->lock);1553 this->lock->destroy(this->lock); 1555 1554 free(this); 1556 1555 } … … 1581 1580 this->cache_queue = linked_list_create(); 1582 1581 this->sets->insert_first(this->sets, this->cache); 1583 pthread_rwlock_init(&this->lock, NULL);1582 this->lock = rwlock_create(RWLOCK_DEFAULT); 1584 1583 1585 1584 return &this->public; trunk/src/charon/credentials/sets/cert_cache.c
r4229 r4591 16 16 */ 17 17 18 #define _GNU_SOURCE19 #include <pthread.h>20 21 18 #include "cert_cache.h" 22 19 20 #include <time.h> 21 23 22 #include <daemon.h> 23 #include <utils/mutex.h> 24 24 #include <utils/linked_list.h> 25 25 … … 57 57 * read-write lock to sets list 58 58 */ 59 pthread_rwlock_tlock;59 rwlock_t *lock; 60 60 }; 61 61 … … 91 91 this->check_required = TRUE; 92 92 } 93 else if ( pthread_rwlock_trywrlock(&this->lock) == 0)93 else if (this->lock->try_write_lock(this->lock)) 94 94 { /* never blocks, only done if lock is available */ 95 95 while (this->relations->get_count(this->relations) > CACHE_SIZE) … … 111 111 } 112 112 this->check_required = FALSE; 113 pthread_rwlock_unlock(&this->lock);113 this->lock->unlock(this->lock); 114 114 } 115 115 } … … 125 125 126 126 /* lookup cache */ 127 pthread_rwlock_rdlock(&this->lock);127 this->lock->read_lock(this->lock); 128 128 enumerator = this->relations->create_enumerator(this->relations); 129 129 while (enumerator->enumerate(enumerator, ¤t)) … … 150 150 } 151 151 enumerator->destroy(enumerator); 152 pthread_rwlock_unlock(&this->lock);152 this->lock->unlock(this->lock); 153 153 if (found) 154 154 { … … 234 234 { 235 235 ref_put(&data->this->enumerating); 236 pthread_rwlock_unlock(&data->this->lock);236 data->this->lock->unlock(data->this->lock); 237 237 if (data->this->check_required) 238 238 { … … 261 261 data->this = this; 262 262 263 pthread_rwlock_rdlock(&this->lock);263 this->lock->read_lock(this->lock); 264 264 ref_get(&this->enumerating); 265 265 return enumerator_create_filter( … … 276 276 relation_t *relation; 277 277 278 pthread_rwlock_wrlock(&this->lock);278 this->lock->write_lock(this->lock); 279 279 enumerator = this->relations->create_enumerator(this->relations); 280 280 while (enumerator->enumerate(enumerator, &relation)) … … 288 288 } 289 289 enumerator->destroy(enumerator); 290 pthread_rwlock_unlock(&this->lock);290 this->lock->unlock(this->lock); 291 291 } 292 292 … … 297 297 { 298 298 this->relations->destroy_function(this->relations, (void*)relation_destroy); 299 pthread_rwlock_destroy(&this->lock);299 this->lock->destroy(this->lock); 300 300 free(this); 301 301 } … … 320 320 this->enumerating = 0; 321 321 this->check_required = FALSE; 322 pthread_rwlock_init(&this->lock, NULL);322 this->lock = rwlock_create(RWLOCK_DEFAULT); 323 323 324 324 return &this->public; trunk/src/charon/plugins/nm/nm_creds.c
r4326 r4591 16 16 */ 17 17 18 #define _GNU_SOURCE19 #include <pthread.h>20 21 18 #include "nm_creds.h" 22 19 23 20 #include <daemon.h> 21 #include <utils/mutex.h> 24 22 25 23 typedef struct private_nm_creds_t private_nm_creds_t; … … 63 61 * read/write lock 64 62 */ 65 pthread_rwlock_tlock;63 rwlock_t *lock; 66 64 }; 67 65 … … 92 90 public->destroy(public); 93 91 } 94 pthread_rwlock_rdlock(&this->lock);92 this->lock->read_lock(this->lock); 95 93 return enumerator_create_cleaner( 96 94 enumerator_create_single(this->usercert, NULL), 97 (void*) pthread_rwlock_unlock, &this->lock);95 (void*)this->lock->unlock, this->lock); 98 96 } 99 97 … … 139 137 public->destroy(public); 140 138 } 141 pthread_rwlock_rdlock(&this->lock);139 this->lock->read_lock(this->lock); 142 140 return enumerator_create_cleaner(enumerator_create_single(this->cert, NULL), 143 (void*) pthread_rwlock_unlock, &this->lock);141 (void*)this->lock->unlock, this->lock); 144 142 } 145 143 … … 168 166 } 169 167 } 170 pthread_rwlock_rdlock(&this->lock);168 this->lock->read_lock(this->lock); 171 169 return enumerator_create_cleaner(enumerator_create_single(this->key, NULL), 172 (void*) pthread_rwlock_unlock, &this->lock);170 (void*)this->lock->unlock, this->lock); 173 171 } 174 172 … … 206 204 { 207 205 this->key->destroy(this->key); 208 pthread_rwlock_unlock(&this->this->lock); 206 this->lock->destroy(this->lock); 207 this->this->lock->unlock(this->this->lock); 209 208 free(this); 210 209 } … … 236 235 enumerator->this = this; 237 236 enumerator->done = FALSE; 238 pthread_rwlock_rdlock(&this->lock);237 this->lock->read_lock(this->lock); 239 238 enumerator->key = shared_key_create(type, 240 239 chunk_clone(chunk_create(this->pass, … … 248 247 static void set_certificate(private_nm_creds_t *this, certificate_t *cert) 249 248 { 250 pthread_rwlock_wrlock(&this->lock);249 this->lock->write_lock(this->lock); 251 250 DESTROY_IF(this->cert); 252 251 this->cert = cert; 253 pthread_rwlock_unlock(&this->lock);252 this->lock->unlock(this->lock); 254 253 } 255 254 … … 260 259 char *password) 261 260 { 262 pthread_rwlock_wrlock(&this->lock);261 this->lock->write_lock(this->lock); 263 262 DESTROY_IF(this->user); 264 263 /* for EAP authentication, we use always use ID_EAP type */ … … 267 266 free(this->pass); 268 267 this->pass = password ? strdup(password) : NULL; 269 pthread_rwlock_unlock(&this->lock);268 this->lock->unlock(this->lock); 270 269 } 271 270 … … 276 275 private_key_t *key) 277 276 { 278 pthread_rwlock_wrlock(&this->lock);277 this->lock->write_lock(this->lock); 279 278 DESTROY_IF(this->key); 280 279 DESTROY_IF(this->usercert); 281 280 this->key = key; 282 281 this->usercert = cert; 283 pthread_rwlock_unlock(&this->lock);282 this->lock->unlock(this->lock); 284 283 } 285 284 … … 307 306 { 308 307 clear(this); 309 pthread_rwlock_destroy(&this->lock);308 this->lock->destroy(this->lock); 310 309 free(this); 311 310 } … … 329 328 this->public.destroy = (void(*)(nm_creds_t*))destroy; 330 329 331 pthread_rwlock_init(&this->lock, NULL);330 this->lock = rwlock_create(RWLOCK_DEFAULT); 332 331 333 332 this->cert = NULL; trunk/src/charon/plugins/stroke/stroke_ca.c
r4229 r4591 17 17 */ 18 18 19 #define _GNU_SOURCE20 #include <pthread.h>21 22 19 #include "stroke_ca.h" 23 20 #include "stroke_cred.h" 24 21 22 #include <utils/mutex.h> 25 23 #include <utils/linked_list.h> 26 24 #include <crypto/hashers/hasher.h> … … 43 41 * read-write lock to lists 44 42 */ 45 pthread_rwlock_tlock;43 rwlock_t *lock; 46 44 47 45 /** … … 137 135 static void cdp_data_destroy(cdp_data_t *data) 138 136 { 139 pthread_rwlock_unlock(&data->this->lock);137 data->this->lock->unlock(data->this->lock); 140 138 free(data); 141 139 } … … 237 235 data->id = id; 238 236 239 pthread_rwlock_rdlock(&this->lock);237 this->lock->read_lock(this->lock); 240 238 return enumerator_create_nested(this->sections->create_enumerator(this->sections), 241 239 (type == CERT_X509) ? (void*)create_inner_cdp_hashandurl : (void*)create_inner_cdp, … … 279 277 ca->certuribase = strdup(msg->add_ca.certuribase); 280 278 } 281 pthread_rwlock_wrlock(&this->lock);279 this->lock->write_lock(this->lock); 282 280 this->sections->insert_last(this->sections, ca); 283 pthread_rwlock_unlock(&this->lock);281 this->lock->unlock(this->lock); 284 282 DBG1(DBG_CFG, "added ca '%s'", msg->add_ca.name); 285 283 } … … 294 292 ca_section_t *ca = NULL; 295 293 296 pthread_rwlock_wrlock(&this->lock);294 this->lock->write_lock(this->lock); 297 295 enumerator = this->sections->create_enumerator(this->sections); 298 296 while (enumerator->enumerate(enumerator, &ca)) … … 306 304 } 307 305 enumerator->destroy(enumerator); 308 pthread_rwlock_unlock(&this->lock);306 this->lock->unlock(this->lock); 309 307 if (ca == NULL) 310 308 { … … 357 355 } 358 356 359 pthread_rwlock_wrlock(&this->lock);357 this->lock->write_lock(this->lock); 360 358 enumerator = this->sections->create_enumerator(this->sections); 361 359 while (enumerator->enumerate(enumerator, (void**)§ion)) … … 373 371 } 374 372 enumerator->destroy(enumerator); 375 pthread_rwlock_unlock(&this->lock);373 this->lock->unlock(this->lock); 376 374 377 375 hasher->destroy(hasher); … … 387 385 enumerator_t *enumerator; 388 386 389 pthread_rwlock_rdlock(&this->lock);387 this->lock->read_lock(this->lock); 390 388 enumerator = this->sections->create_enumerator(this->sections); 391 389 while (enumerator->enumerate(enumerator, (void**)§ion)) … … 420 418 } 421 419 enumerator->destroy(enumerator); 422 pthread_rwlock_unlock(&this->lock);420 this->lock->unlock(this->lock); 423 421 } 424 422 … … 429 427 { 430 428 this->sections->destroy_function(this->sections, (void*)ca_section_destroy); 431 pthread_rwlock_destroy(&this->lock);429 this->lock->destroy(this->lock); 432 430 free(this); 433 431 } … … 452 450 453 451 this->sections = linked_list_create(); 454 pthread_rwlock_init(&this->lock, NULL);452 this->lock = rwlock_create(RWLOCK_DEFAULT); 455 453 this->cred = cred; 456 454 trunk/src/charon/plugins/stroke/stroke_cred.c
r4317 r4591 16 16 */ 17 17 18 #define _GNU_SOURCE19 #include <pthread.h>20 18 #include <sys/stat.h> 21 19 #include <limits.h> … … 29 27 #include <utils/linked_list.h> 30 28 #include <utils/lexparser.h> 29 #include <utils/mutex.h> 31 30 #include <asn1/pem.h> 32 31 #include <daemon.h> … … 74 73 * read-write lock to lists 75 74 */ 76 pthread_rwlock_tlock;75 rwlock_t *lock; 77 76 78 77 /** … … 95 94 static void id_data_destroy(id_data_t *data) 96 95 { 97 pthread_rwlock_unlock(&data->this->lock);96 data->this->lock->unlock(data->this->lock); 98 97 free(data); 99 98 } … … 141 140 data->id = id; 142 141 143 pthread_rwlock_rdlock(&this->lock);142 this->lock->read_lock(this->lock); 144 143 return enumerator_create_filter(this->private->create_enumerator(this->private), 145 144 (void*)private_filter, data, … … 242 241 data->id = id; 243 242 244 pthread_rwlock_rdlock(&this->lock);243 this->lock->read_lock(this->lock); 245 244 return enumerator_create_filter(this->certs->create_enumerator(this->certs), 246 245 (cert == CERT_X509_CRL)? (void*)crl_filter : (void*)ac_filter, … … 255 254 data->id = id; 256 255 257 pthread_rwlock_rdlock(&this->lock);256 this->lock->read_lock(this->lock); 258 257 return enumerator_create_filter(this->certs->create_enumerator(this->certs), 259 258 (void*)certs_filter, data, … … 273 272 static void shared_data_destroy(shared_data_t *data) 274 273 { 275 pthread_rwlock_unlock(&data->this->lock);274 data->this->lock->unlock(data->this->lock); 276 275 free(data); 277 276 } … … 325 324 data->other = other; 326 325 data->type = type; 327 pthread_rwlock_rdlock(&this->lock);326 this->lock->read_lock(this->lock); 328 327 return enumerator_create_filter(this->shared->create_enumerator(this->shared), 329 328 (void*)shared_filter, data, … … 340 339 bool new = TRUE; 341 340 342 pthread_rwlock_rdlock(&this->lock);341 this->lock->read_lock(this->lock); 343 342 enumerator = this->certs->create_enumerator(this->certs); 344 343 while (enumerator->enumerate(enumerator, (void**)¤t)) … … 359 358 this->certs->insert_last(this->certs, cert); 360 359 } 361 pthread_rwlock_unlock(&this->lock);360 this->lock->unlock(this->lock); 362 361 return cert; 363 362 } … … 401 400 bool new = TRUE, found = FALSE; 402 401 403 pthread_rwlock_wrlock(&this->lock);402 this->lock->write_lock(this->lock); 404 403 enumerator = this->certs->create_enumerator(this->certs); 405 404 while (enumerator->enumerate(enumerator, (void**)¤t)) … … 449 448 this->certs->insert_last(this->certs, cert); 450 449 } 451 pthread_rwlock_unlock(&this->lock);450 this->lock->unlock(this->lock); 452 451 return new; 453 452 } … … 460 459 certificate_t *cert = &ac->certificate; 461 460 462 pthread_rwlock_wrlock(&this->lock);461 this->lock->write_lock(this->lock); 463 462 this->certs->insert_last(this->certs, cert); 464 pthread_rwlock_unlock(&this->lock);463 this->lock->unlock(this->lock); 465 464 return TRUE; 466 465 } … … 699 698 src = chunk; 700 699 701 pthread_rwlock_wrlock(&this->lock);700 this->lock->write_lock(this->lock); 702 701 while (this->shared->remove_last(this->shared, 703 702 (void**)&shared) == SUCCESS) … … 869 868 } 870 869 error: 871 pthread_rwlock_unlock(&this->lock);870 this->lock->unlock(this->lock); 872 871 chunk_clear(&chunk); 873 872 } … … 950 949 this->shared->destroy_offset(this->shared, offsetof(shared_key_t, destroy)); 951 950 this->private->destroy_offset(this->private, offsetof(private_key_t, destroy)); 952 pthread_rwlock_destroy(&this->lock);951 this->lock->destroy(this->lock); 953 952 free(this); 954 953 } … … 975 974 this->shared = linked_list_create(); 976 975 this->private = linked_list_create(); 977 pthread_rwlock_init(&this->lock, NULL);976 this->lock = rwlock_create(RWLOCK_DEFAULT); 978 977 979 978 load_certs(this); trunk/src/libstrongswan/fetcher/fetcher_manager.c
r4576 r4591 16 16 */ 17 17 18 #define _GNU_SOURCE19 #include <pthread.h>20 21 18 #include "fetcher_manager.h" 22 19 23 20 #include <debug.h> 21 #include <utils/mutex.h> 24 22 #include <utils/linked_list.h> 25 #include <utils/mutex.h>26 23 27 24 typedef struct private_fetcher_manager_t private_fetcher_manager_t; … … 45 42 * read write lock to list 46 43 */ 47 pthread_rwlock_tlock;44 rwlock_t *lock; 48 45 }; 49 46 … … 75 72 bool capable = FALSE; 76 73 77 pthread_rwlock_rdlock(&this->lock);74 this->lock->read_lock(this->lock); 78 75 enumerator = this->fetchers->create_enumerator(this->fetchers); 79 76 while (enumerator->enumerate(enumerator, &entry)) … … 133 130 } 134 131 enumerator->destroy(enumerator); 135 pthread_rwlock_unlock(&this->lock);132 this->lock->unlock(this->lock); 136 133 if (!capable) 137 134 { … … 152 149 entry->create = create; 153 150 154 pthread_rwlock_wrlock(&this->lock);151 this->lock->write_lock(this->lock); 155 152 this->fetchers->insert_last(this->fetchers, entry); 156 pthread_rwlock_unlock(&this->lock);153 this->lock->unlock(this->lock); 157 154 } 158 155 … … 166 163 entry_t *entry; 167 164 168 pthread_rwlock_wrlock(&this->lock);165 this->lock->write_lock(this->lock); 169 166 enumerator = this->fetchers->create_enumerator(this->fetchers); 170 167 while (enumerator->enumerate(enumerator, &entry)) … … 177 174 } 178 175 enumerator->destroy(enumerator); 179 pthread_rwlock_unlock(&this->lock);176 this->lock->unlock(this->lock); 180 177 } 181 178 … … 186 183 { 187 184 this->fetchers->destroy_function(this->fetchers, (void*)entry_destroy); 188 pthread_rwlock_destroy(&this->lock);185 this->lock->destroy(this->lock); 189 186 free(this); 190 187 } … … 203 200 204 201 this->fetchers = linked_list_create(); 205 pthread_rwlock_init(&this->lock, NULL);202 this->lock = rwlock_create(RWLOCK_DEFAULT); 206 203 207 204 return &this->public; trunk/src/libstrongswan/utils/mutex.c
r4590 r4591 16 16 */ 17 17 18 #include "mutex.h" 19 20 #include <library.h> 21 #include <debug.h> 22 18 #define _GNU_SOURCE 23 19 #include <pthread.h> 24 20 #include <sys/time.h> … … 26 22 #include <time.h> 27 23 #include <errno.h> 24 25 #include "mutex.h" 26 27 #include <library.h> 28 #include <debug.h> 28 29 29 30 typedef struct private_mutex_t private_mutex_t; … … 442 443 443 444 /** 445 * Implementation of rwlock_t.try_write_lock 446 */ 447 static bool try_write_lock(private_rwlock_t *this) 448 { 449 return pthread_rwlock_trywrlock(&this->rwlock) == 0; 450 } 451 452 /** 444 453 * Implementation of rwlock_t.unlock 445 454 */ … … 473 482 this->public.read_lock = (void(*)(rwlock_t*))read_lock; 474 483 this->public.write_lock = (void(*)(rwlock_t*))write_lock; 484 this->public.try_write_lock = (bool(*)(rwlock_t*))try_write_lock; 475 485 this->public.unlock = (void(*)(rwlock_t*))rw_unlock; 476 486 this->public.destroy = (void(*)(rwlock_t*))rw_destroy; trunk/src/libstrongswan/utils/mutex.h
r4590 r4591 131 131 132 132 /** 133 * Try to acquire the write lock. 134 * 135 * Never blocks, but returns FALSE if the lock was already occupied. 136 * 137 * @return TRUE if lock acquired 138 */ 139 bool (*try_write_lock)(rwlock_t *this); 140 141 /** 133 142 * Release any acquired lock. 134 143 */
