123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- #include "rwlock.h"
- #include <stdlib.h>
- void wtlock(prwlock_t lock)
- {
- int ret = pthread_rwlock_wrlock(lock);
- if(0 != ret)
- abort();
- }
- void wtunlock(prwlock_t lock)
- {
- int ret = pthread_rwlock_unlock(lock);
- if(0 != ret)
- abort();
- }
- void rdlock(prwlock_t lock)
- {
- int ret = pthread_rwlock_rdlock(lock);
- if(0 != ret)
- abort();
- }
- void rdunlock(prwlock_t lock)
- {
- int ret = pthread_rwlock_unlock(lock);
- if(0 != ret)
- abort();
- }
- void init_rwlock(prwlock_t lock)
- {
-
- int ret = pthread_rwlock_init(lock, NULL);
- if(0 != ret)
- abort();
- }
- void fini_rwlock(prwlock_t lock)
- {
- int ret = pthread_rwlock_destroy(lock);
- if(0 != ret)
- abort();
- }
|