@@ -301,13 +301,15 @@ inline void pthread_exit(void *value_ptr)
301
301
{
302
302
__CPROVER_HIDE :;
303
303
if (value_ptr != 0 ) (void )* (char * )value_ptr ;
304
+ #if 0
304
305
for (unsigned long i = 0 ; i < __CPROVER_next_thread_key ; ++ i )
305
306
{
306
307
const void * key = __CPROVER_thread_keys [i ];
307
308
__CPROVER_thread_keys [i ] = 0 ;
308
309
if (__CPROVER_thread_key_dtors [i ] && key )
309
310
__CPROVER_thread_key_dtors [i ](key );
310
311
}
312
+ #endif
311
313
__CPROVER_threads_exited [__CPROVER_thread_id ]= 1 ;
312
314
__CPROVER_assume (0 );
313
315
}
@@ -541,16 +543,20 @@ extern __CPROVER_thread_local unsigned long __CPROVER_next_thread_key;
541
543
542
544
inline void __spawned_thread (
543
545
unsigned long this_thread_id ,
546
+ #if 0
544
547
void (* * thread_key_dtors )(void * ),
548
+ #endif
545
549
unsigned long next_thread_key ,
546
550
void * (* start_routine )(void * ),
547
551
void * arg )
548
552
{
549
553
__CPROVER_HIDE :;
550
554
__CPROVER_thread_id = this_thread_id ;
551
555
__CPROVER_next_thread_key = next_thread_key ;
556
+ #if 0
552
557
for (unsigned long i = 0 ; i < __CPROVER_next_thread_key ; ++ i )
553
558
__CPROVER_thread_key_dtors [i ] = thread_key_dtors [i ];
559
+ #endif
554
560
#ifdef __CPROVER_CUSTOM_BITVECTOR_ANALYSIS
555
561
// Clear all locked mutexes; locking must happen in same thread.
556
562
__CPROVER_clear_must (0 , "mutex-locked" );
@@ -566,13 +572,15 @@ __CPROVER_HIDE:;
566
572
"RRcumul" ,
567
573
"RWcumul" ,
568
574
"WRcumul" );
575
+ #if 0
569
576
for (unsigned long i = 0 ; i < __CPROVER_next_thread_key ; ++ i )
570
577
{
571
578
const void * key = __CPROVER_thread_keys [i ];
572
579
__CPROVER_thread_keys [i ] = 0 ;
573
580
if (__CPROVER_thread_key_dtors [i ] && key )
574
581
__CPROVER_thread_key_dtors [i ](key );
575
582
}
583
+ #endif
576
584
__CPROVER_threads_exited [this_thread_id ] = 1 ;
577
585
}
578
586
@@ -598,11 +606,19 @@ inline int pthread_create(
598
606
if (attr ) (void )* attr ;
599
607
600
608
unsigned long next_thread_key = __CPROVER_next_thread_key ;
609
+ #if 0
601
610
void (* * thread_key_dtors )(void * ) = __CPROVER_thread_key_dtors ;
611
+ #endif
602
612
603
613
__CPROVER_ASYNC_1 :
604
614
__spawned_thread (
605
- this_thread_id , thread_key_dtors , next_thread_key , start_routine , arg );
615
+ this_thread_id ,
616
+ #if 0
617
+ thread_key_dtors ,
618
+ #endif
619
+ next_thread_key ,
620
+ start_routine ,
621
+ arg );
606
622
607
623
return 0 ;
608
624
}
@@ -895,7 +911,11 @@ inline int pthread_key_create(pthread_key_t *key, void (*destructor)(void *))
895
911
{
896
912
__CPROVER_HIDE :;
897
913
__CPROVER_thread_keys [__CPROVER_next_thread_key ] = 0 ;
914
+ #if 0
898
915
__CPROVER_thread_key_dtors [__CPROVER_next_thread_key ] = destructor ;
916
+ #else
917
+ __CPROVER_precondition (destructor == 0 , "destructors are not yet supported" );
918
+ #endif
899
919
* key = __CPROVER_next_thread_key ++ ;
900
920
return 0 ;
901
921
}
0 commit comments