@@ -197,47 +197,6 @@ void INTERNAL qthread_steal_enable(void) {}
197197
198198void INTERNAL qthread_steal_disable (void ) {}
199199
200- #ifdef QTHREAD_PARANOIA
201- static void sanity_check_tq (NEMESIS_queue * q ) { /*{{{*/
202- qt_threadqueue_node_t * curs ;
203-
204- assert (q );
205- /*if (q->head != NULL) {
206- * assert(q->tail != NULL);
207- * }*/
208- if (q -> shadow_head ) { assert (q -> head != q -> shadow_head ); }
209- if (atomic_load_explicit (& q -> tail , memory_order_relaxed ) != NULL ) {
210- if (atomic_load_explicit (& q -> head , memory_order_relaxed ) == NULL ) {
211- assert (q -> shadow_head != NULL );
212- }
213- }
214- if ((atomic_load_explicit (& q -> head , memory_order_relaxed ) != NULL ) ||
215- (atomic_load_explicit (& q -> tail , memory_order_relaxed ) != NULL )) {
216- if (q -> shadow_head ) {
217- curs = q -> shadow_head ;
218- assert (curs -> thread );
219- assert (curs -> thread != (void * )0x7777777777777777 );
220- while (atomic_load_explicit (& curs -> next , memory_order_relaxed )) {
221- curs = atomic_load_explicit (& curs -> next , memory_order_relaxed );
222- assert (curs -> thread );
223- assert (curs -> thread != (void * )0x7777777777777777 );
224- }
225- }
226- if (q -> head ) {
227- curs = q -> head ;
228- assert (curs -> thread );
229- assert (curs -> thread != (void * )0x7777777777777777 );
230- while (atomic_load_explicit (& curs -> next , memory_order_relaxed )) {
231- curs = atomic_load_explicit (& curs -> next , memory_order_relaxed );
232- assert (curs -> thread );
233- assert (curs -> thread != (void * )0x7777777777777777 );
234- }
235- }
236- }
237- } /*}}}*/
238-
239- #endif /* ifdef QTHREAD_PARANOIA */
240-
241200qthread_shepherd_id_t INTERNAL
242201qt_threadqueue_choose_dest (qthread_shepherd_t * curr_shep ) {
243202 qthread_shepherd_id_t dest_shep_id = 0 ;
@@ -260,8 +219,6 @@ void INTERNAL qt_threadqueue_enqueue(qt_threadqueue_t *restrict q,
260219 assert (q );
261220 assert (t );
262221
263- PARANOIA (sanity_check_tq (& q -> q ));
264-
265222 node = ALLOC_TQNODE ();
266223 assert (node != NULL );
267224 node -> thread = t ;
@@ -274,7 +231,6 @@ void INTERNAL qt_threadqueue_enqueue(qt_threadqueue_t *restrict q,
274231 } else {
275232 atomic_store_explicit (& prev -> next , node , memory_order_relaxed );
276233 }
277- PARANOIA (sanity_check_tq (& q -> q ));
278234 (void )qthread_incr (& (q -> advisory_queuelen ), 1 );
279235#ifdef QTHREAD_CONDWAIT_BLOCKING_QUEUE
280236 /* awake waiter */
@@ -310,11 +266,10 @@ qt_scheduler_get_thread(qt_threadqueue_t *q,
310266#ifdef QTHREAD_CONDWAIT_BLOCKING_QUEUE
311267 int i ;
312268#endif /* QTHREAD_CONDWAIT_BLOCKING_QUEUE */
313- PARANOIA ( sanity_check_tq ( & q -> q ));
269+
314270 qt_threadqueue_node_t * node = qt_internal_NEMESIS_dequeue (& q -> q );
315271 qthread_t * retval ;
316272
317- PARANOIA (sanity_check_tq (& q -> q ));
318273 if (node == NULL ) {
319274#ifdef QTHREAD_CONDWAIT_BLOCKING_QUEUE
320275 i = num_spins_before_condwait ;
@@ -345,7 +300,6 @@ qt_scheduler_get_thread(qt_threadqueue_t *q,
345300 (void )qthread_incr (& (q -> advisory_queuelen ), -1 );
346301 retval = node -> thread ;
347302 FREE_TQNODE (node );
348- PARANOIA (sanity_check_tq (& q -> q ));
349303 return retval ;
350304} /*}}} */
351305
@@ -361,11 +315,8 @@ void INTERNAL qt_threadqueue_filter(qt_threadqueue_t *q,
361315 atomic_init (& tmp .tail , NULL );
362316 tmp .shadow_head = NULL ;
363317 tmp .nemesis_advisory_queuelen = 0 ;
364- PARANOIA (sanity_check_tq (& q -> q ));
365318 while ((curs = qt_internal_NEMESIS_dequeue_st (& q -> q ))) {
366319 qthread_t * t = curs -> thread ;
367- PARANOIA (sanity_check_tq (& tmp ));
368- PARANOIA (sanity_check_tq (& q -> q ));
369320 switch (f (t )) {
370321 case IGNORE_AND_CONTINUE : // ignore, move on
371322 prev = qt_internal_atomic_swap_ptr ((void * * )& (tmp .tail ), curs );
@@ -395,7 +346,6 @@ void INTERNAL qt_threadqueue_filter(qt_threadqueue_t *q,
395346 }
396347pushback :
397348 /* dequeue the rest of the queue */
398- PARANOIA (sanity_check_tq (& tmp ));
399349 if (atomic_load_explicit (& q -> q .head , memory_order_relaxed )) {
400350 prev = qt_internal_atomic_swap_ptr ((void * * )& (tmp .tail ), q -> q .head );
401351 if (prev == NULL ) {
@@ -423,7 +373,6 @@ void INTERNAL qt_threadqueue_filter(qt_threadqueue_t *q,
423373 memory_order_relaxed );
424374 q -> q .shadow_head = NULL ;
425375 q -> advisory_queuelen = tmp .nemesis_advisory_queuelen ;
426- PARANOIA (sanity_check_tq (& q -> q ));
427376} /*}}}*/
428377
429378/* some place-holder functions */
0 commit comments