if (lock == NULL)
return (EINVAL);
if (pshared == PTHREAD_PROCESS_PRIVATE) {
lck = malloc(sizeof(struct pthread_spinlock));
lck = malloc(roundup(sizeof(struct pthread_spinlock), CACHE_LINE_SIZE));
if (lck == NULL)
return (ENOMEM);
*lock = lck;
if (attr == NULL || *attr == NULL ||
(*attr)->pshared == PTHREAD_PROCESS_PRIVATE) {
prwlock = calloc(1, sizeof(struct pthread_rwlock));
prwlock = calloc(1, roundup(sizeof(struct pthread_rwlock), CACHE_LINE_SIZE));
if (prwlock == NULL)
*rwlock = prwlock;