| 329 | } |
| 330 | |
| 331 | int bthread_rwlock_destroy(bthread_rwlock_t* rwlock) { |
| 332 | bthread_sem_destroy(&rwlock->reader_sema); |
| 333 | bthread_sem_destroy(&rwlock->writer_sema); |
| 334 | bthread_mutex_destroy(&rwlock->write_queue_mutex); |
| 335 | return 0; |
| 336 | } |
| 337 | |
| 338 | int bthread_rwlock_rdlock(bthread_rwlock_t* rwlock) { |
| 339 | return bthread::rwlock_rdlock(rwlock); |