/* * Copyright (c) 2002, Intel Corporation. All rights reserved. * Created by: rolla.n.selbak REMOVE-THIS AT intel DOT com * This file is licensed under the GPL license. For the full content * of this license, see the COPYING file at the top level of this * source tree. * Test pthread_create() * The thread is created executing 'start_routine' with 'arg' as its only * argument. * * Steps: * 1. Create 5 separete threads using pthread_create() passing to it a single int 'arg'. * 2. Use that passed int argument in the thread function start routine and make sure no * errors occur. */ #include #include #include #include "posixtest.h" #define NUM_THREADS 5 /* The thread start routine. */ void *a_thread_func(void* num) { intptr_t i = (intptr_t) num; printf("Passed argument for thread: %d\n", (int)i); pthread_exit(0); return NULL; } int main() { pthread_t new_th; long i; for(i=1;i