发布时间:2014-12-17 15:22:49
#include <fcntl.h>int fcntl(int fd, int cmd, .../* struct flock *arg */ );返回值:若成功则取决于cmd,若出错则返回-1;用于记录上锁的cmd参数共有三个值。F_SETLK ----获取(l_type为F_RDLCK或F_WRLCK)或释放(F_UNLCK)由arg指向的flock结构所描述的锁,如果无法获取锁,该函数立即返回一个EACCES.........【阅读全文】
发布时间:2014-12-16 15:13:25
点击(此处)折叠或打开#include "../unipc.h"#include "pthread_rwlock.h"int my_pthread_rwlock_destroy(my_pthread_rwlock_t * rw){ if(rw->rw_magic != RW_MAGIC)&nb.........【阅读全文】
发布时间:2014-12-16 15:12:43
点击(此处)折叠或打开#include "../unipc.h"#include "pthread_rwlock.h"int my_pthread_rwlock_init(my_pthread_rwlock_t *rw, my_pthread_rwlockattr_t *attr){ int .........【阅读全文】
发布时间:2014-12-16 15:11:54
点击(此处)折叠或打开#include "../unipc.h"#include "pthread_rwlock.h"int my_pthread_rwlock_trywrlock(pthread_rwlock_t *rw){ int rc; if.........【阅读全文】
发布时间:2014-12-16 15:10:42
点击(此处)折叠或打开#include "../unipc.h"#include "pthread_rwlock.h"int my_pthread_rwlock_wrlock(pthread_rwlock_t *rw){ int rc; if(rw.........【阅读全文】