/*====================================================================*/
/* This software is delivered "as-is", with no warranties             */
/* expressed or implied.  This software is not supported by IBM.      */
/*====================================================================*/
/* (C) COPYRIGHT International Business Machines Corp. 2001           */
/* All Rights Reserved                                                */
/*                                                                    */
/* US Government Users Restricted Rights - Use, duplication or        */
/* disclosure restricted by GSA ADP Schedule Contract with IBM Corp.  */
/*====================================================================*/

#include <sys/processor.h>
#include <sys/time.h>
#include <stdio.h>

void bind_thread (int *itask)
{
int rc;
cpu_t cpu_id;
cpu_id = (cpu_t) *itask;
/*  usleep(10000); */
  if (rc = bindprocessor (BINDTHREAD, thread_self(), cpu_id)) {
    printf ("bind_thread: bindprocessor failed rc = %i\n",rc);
    exit();
  } else{
    printf( "bindprocessor successful: thread_self() %i cpu_id %i\n",
            thread_self(), cpu_id );
  }
}

