In a lot of the thread code, I see something like the following
How come the the lock is placed AFTER head and tail are set to NULL? ICode:int queue_int(struct queue *qp) { int err; qp->head = NULL; qp->tail = NULL; err = pthread_rwlock_init(&qp->qp->lock, NULL); /*more code*/ }
guess I don't understand the reason why you wouldn't place the lock
BEFORE setting head and tail to NULL.