git.haldean.org ubik / 7ea85f1
clean up some pointer logic in jobq_push and jobq_pop Haldean Brown 5 years ago
1 changed file(s) with 7 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
6262 n->right = sq->tail;
6363 if (sq->tail != NULL)
6464 sq->tail->left = n;
65 if (sq->head == NULL)
65 else
6666 sq->head = n;
6767 sq->tail = n;
6868 sq->size++;
102102 if (n != NULL)
103103 {
104104 sq->head = n->left;
105 if (sq->head == NULL)
106 sq->tail = NULL;
107 else
108 sq->head->right = NULL;
105109 sq->size--;
106 if (!sq->size)
107 sq->tail = NULL;
108110 }
109111 }
110112 if (n == NULL)
115117 q->global_head = n->left;
116118 if (q->global_head == NULL)
117119 q->global_tail = NULL;
120 else
121 q->global_head->right = NULL;
118122 pthread_mutex_unlock(&q->global_lock);
119123 }
120124 if (n == NULL)