Use PRIxpthread_t to print pthread_t's.

This commit is contained in:
Ralf Corsepius
2009-10-27 14:10:54 +00:00
parent 749eae9753
commit 39615f481a
22 changed files with 31 additions and 31 deletions

View File

@@ -45,7 +45,7 @@ void *POSIX_Init(
/* get id of this thread */
Init_id = pthread_self();
printf( "Init: ID is 0x%08x\n", Init_id );
printf( "Init: ID is 0x%08" PRIxpthread_t "\n", Init_id );
/* exercise get minimum priority */

View File

@@ -48,7 +48,7 @@ void *Task_1_through_3(
/* get id of this thread */
Task_id = pthread_self();
printf( "Task_1: ID is 0x%08x\n", Task_id );
printf( "Task_1: ID is 0x%08" PRIxpthread_t "\n", Task_id );
/* exercise pthread_equal */

View File

@@ -51,7 +51,7 @@ void *POSIX_Init(
/* get id of this thread */
Init_id = pthread_self();
printf( "Init's ID is 0x%08x\n", Init_id );
printf( "Init's ID is 0x%08" PRIxpthread_t "\n", Init_id );
/* install a signal handler */

View File

@@ -24,7 +24,7 @@ void Signal_handler(
{
Signal_count++;
printf(
"Signal: %d caught by 0x%x (%d)\n",
"Signal: %d caught by 0x%" PRIxpthread_t " (%d)\n",
signo,
pthread_self(),
Signal_count
@@ -53,7 +53,7 @@ void *POSIX_Init(
/* get id of this thread */
Init_id = pthread_self();
printf( "Init's ID is 0x%08x\n", Init_id );
printf( "Init's ID is 0x%08" PRIxpthread_t "\n", Init_id );
/* install a signal handler */

View File

@@ -29,7 +29,7 @@ void Signal_handler(
{
Signal_count++;
printf(
"Signal: %d caught by 0x%x (%d)\n",
"Signal: %d caught by 0x%" PRIxpthread_t " (%d)\n",
signo,
pthread_self(),
Signal_count
@@ -45,7 +45,7 @@ void Signal_info_handler(
{
Signal_count++;
printf(
"Signal_info: %d caught by 0x%x (%d) si_signo= %d si_code= %d value= %d\n",
"Signal_info: %d caught by 0x%" PRIxpthread_t " (%d) si_signo= %d si_code= %d value= %d\n",
signo,
pthread_self(),
Signal_count,
@@ -78,7 +78,7 @@ void *POSIX_Init(
/* get id of this thread */
Init_id = pthread_self();
printf( "Init's ID is 0x%08x\n", Init_id );
printf( "Init's ID is 0x%08" PRIxpthread_t "\n", Init_id );
/* generate some easy error cases */

View File

@@ -135,7 +135,7 @@ void *POSIX_Init(
/* get id of this thread */
Init_id = pthread_self();
printf( "Init's ID is 0x%08x\n", Init_id );
printf( "Init's ID is 0x%08" PRIxpthread_t "\n", Init_id );
/* tes pthread_mutex_attr_init */

View File

@@ -47,7 +47,7 @@ void *POSIX_Init(
/* get id of this thread */
Init_id = pthread_self();
printf( "Init's ID is 0x%08x\n", Init_id );
printf( "Init's ID is 0x%08" PRIxpthread_t "\n", Init_id );
/* create a couple of threads */

View File

@@ -78,7 +78,7 @@ void *POSIX_Init(
/* get id of this thread */
Init_id = pthread_self();
printf( "Init's ID is 0x%08x\n", Init_id );
printf( "Init's ID is 0x%08" PRIxpthread_t "\n", Init_id );
/* exercise init and destroy */

View File

@@ -29,7 +29,7 @@ void *POSIX_Init(
/* get id of this thread */
Init_id = pthread_self();
printf( "Init's ID is 0x%08x\n", Init_id );
printf( "Init's ID is 0x%08" PRIxpthread_t "\n", Init_id );
puts( "Init: pthread_detach - ESRCH (invalid id)" );
status = pthread_detach( (pthread_t) -1 );

View File

@@ -66,7 +66,7 @@ void *POSIX_Init(
/* get id of this thread */
Init_id = pthread_self();
printf( "Init's ID is 0x%08x\n", Init_id );
printf( "Init's ID is 0x%08" PRIxpthread_t "\n", Init_id );
/* try to use this thread as a sporadic server */

View File

@@ -28,7 +28,7 @@ void *Task_1(
/* wait for a condition variable signal from Init */
Task_id = pthread_self();
printf( "Task_1: ID is 0x%08x\n", Task_id );
printf( "Task_1: ID is 0x%08" PRIxpthread_t "\n", Task_id );
status = pthread_mutex_init( &Mutex_id, NULL );
assert( !status );

View File

@@ -26,7 +26,7 @@ void *Task_2(
int status;
Task_id = pthread_self();
printf( "Task_2: ID is 0x%08x\n", Task_id );
printf( "Task_2: ID is 0x%08" PRIxpthread_t "\n", Task_id );
status = pthread_mutex_lock( &Mutex_id );
assert( !status );

View File

@@ -26,7 +26,7 @@ void *Task_3(
int status;
Task_id = pthread_self();
printf( "Task_3: ID is 0x%08x\n", Task_id );
printf( "Task_3: ID is 0x%08" PRIxpthread_t "\n", Task_id );
status = pthread_mutex_lock( &Mutex_id );
assert( !status );

View File

@@ -36,7 +36,7 @@ void *POSIX_Init(
/* get id of this thread */
Init_id = pthread_self();
printf( "Init's ID is 0x%08x\n", Init_id );
printf( "Init's ID is 0x%08" PRIxpthread_t "\n", Init_id );
/* exercise pthread_setschedparam */

View File

@@ -56,7 +56,7 @@ void *POSIX_Init(
/* get id of this thread */
Init_id = pthread_self();
printf( "Init's ID is 0x%08x\n", Init_id );
printf( "Init's ID is 0x%08" PRIxpthread_t "\n", Init_id );
/* invalid scheduling policy error */

View File

@@ -29,7 +29,7 @@ void Signal_handler(
{
Signal_count++;
printf(
"Signal: %d caught by 0x%x (%d)\n",
"Signal: %d caught by 0x%" PRIxpthread_t " (%d)\n",
signo,
pthread_self(),
Signal_count
@@ -45,7 +45,7 @@ void Signal_info_handler(
{
Signal_count++;
printf(
"Signal_info: %d caught by 0x%x (%d) si_signo= %d si_code= %d value= %d\n",
"Signal_info: %d caught by 0x%" PRIxpthread_t " (%d) si_signo= %d si_code= %d value= %d\n",
signo,
pthread_self(),
Signal_count,

View File

@@ -29,9 +29,9 @@ void *BarrierThread(void *arg)
pthread_t id = *(pthread_t *) arg;
int status;
printf( "pthread_barrier_wait( &Barrier ) for thread 0x%08x\n", id );
printf( "pthread_barrier_wait( &Barrier ) for thread 0x%08" PRIxpthread_t "\n", id );
status = pthread_barrier_wait( &Barrier );
printf( "pthread_barrier_wait - 0x%08x released\n", id );
printf( "pthread_barrier_wait - 0x%08" PRIxpthread_t " released\n", id );
assert( (status == 0) || (status == PTHREAD_BARRIER_SERIAL_THREAD) );
return NULL;

View File

@@ -40,7 +40,7 @@ void *POSIX_Init(
/* get id of this thread */
Init_id = pthread_self();
printf( "Init's ID is 0x%08x\n", Init_id );
printf( "Init's ID is 0x%08" PRIxpthread_t "\n", Init_id );
Allocate_majority_of_workspace(84);

View File

@@ -29,7 +29,7 @@ void *Task_1(
int status;
uint32_t *key_data;
printf( "Thread 0x%08x\n", id );
printf( "Thread 0x%08" PRIxpthread_t "\n", id );
printf( "Task_1: Setting the key to %d\n", 1 );
status = pthread_setspecific( Key_id[0], (void *)&Data_array[ 1 ] );
if ( status )

View File

@@ -42,7 +42,7 @@ void *POSIX_Init(
/* get id of this thread */
Init_id = pthread_self();
printf( "Init's ID is 0x%08x\n", Init_id );
printf( "Init's ID is 0x%08" PRIxpthread_t "\n", Init_id );
Allocate_majority_of_workspace(NAME_MAX);

View File

@@ -26,7 +26,7 @@ void Handler_1(
{
Signal_count++;
printf(
"Handler_1: Signal: %d caught by 0x%x (%d)\n",
"Handler_1: Signal: %d caught by 0x%" PRIxpthread_t " (%d)\n",
signo,
pthread_self(),
Signal_count
@@ -40,7 +40,7 @@ void Signal_handler(
{
Signal_count++;
printf(
"Signal: %d caught by 0x%x (%d)\n",
"Signal: %d caught by 0x%"PRIxpthread_t " (%d)\n",
signo,
pthread_self(),
Signal_count
@@ -56,7 +56,7 @@ void Signal_info_handler(
{
Signal_count++;
printf(
"Signal_info: %d caught by 0x%x (%d) si_signo= %d si_code= %d value= %d\n",
"Signal_info: %d caught by 0x%" PRIxpthread_t " (%d) si_signo= %d si_code= %d value= %d\n",
signo,
pthread_self(),
Signal_count,
@@ -97,7 +97,7 @@ void *POSIX_Init(
/* get id of this thread */
Init_id = pthread_self();
printf( "Init's ID is 0x%08x\n", Init_id );
printf( "Init's ID is 0x%08" PRIxpthread_t "\n", Init_id );
Signal_occurred = 0;
Signal_count = 0;

View File

@@ -27,7 +27,7 @@ void Signal_handler(
{
Signal_count++;
printf(
"Signal: %d caught by 0x%x (%d)\n",
"Signal: %d caught by 0x%" PRIxpthread_t " (%d)\n",
signo,
pthread_self(),
Signal_count
@@ -63,7 +63,7 @@ void *POSIX_Init(
/* get id of this thread */
Init_id = pthread_self();
printf( "Init's ID is 0x%08x\n", Init_id );
printf( "Init's ID is 0x%08" PRIxpthread_t "\n", Init_id );
Signal_occurred = 0;
Signal_count = 0;