1 /* This test triggers execution of the code that releases per-thread
2 transaction data when a thread exists, potentially repeatedly. However,
3 we currently cannot check whether the data has indeed been released. */
5 /* { dg-options "-pthread" } */
12 static pthread_key_t key
;
15 thread_exit_handler(void *dummy
__attribute__((unused
)))
21 // ??? It would be good if we could check here that the transaction has
22 // indeed been released.
23 __transaction_atomic
{ round
++; }
24 if (pthread_setspecific(key
, &round
))
27 // ??? It would be good if we could check here that the transaction has
28 // indeed been released (again).
31 static void *thread (void *dummy
__attribute__((unused
)))
33 if (pthread_key_create(&key
, thread_exit_handler
))
35 if (pthread_setspecific(key
, &round
))
37 __transaction_atomic
{ round
++; }
44 pthread_create(&pt
, NULL
, thread
, NULL
);
45 pthread_join(pt
, NULL
);