| 439 | extern "C" { |
| 440 | |
| 441 | int bthread_keytable_pool_init(bthread_keytable_pool_t* pool) { |
| 442 | if (pool == NULL) { |
| 443 | LOG(ERROR) << "Param[pool] is NULL"; |
| 444 | return EINVAL; |
| 445 | } |
| 446 | pthread_rwlock_init(&pool->rwlock, NULL); |
| 447 | pool->list = new butil::ThreadLocal<bthread::KeyTableList>(); |
| 448 | pool->free_keytables = NULL; |
| 449 | pool->size = 0; |
| 450 | pool->destroyed = 0; |
| 451 | return 0; |
| 452 | } |
| 453 | |
| 454 | int bthread_keytable_pool_destroy(bthread_keytable_pool_t* pool) { |
| 455 | if (pool == NULL) { |
no outgoing calls