Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static buffer [64];
- return buffer ;
- n=6;
- pthread_t thread_ID[n];
- void *thread_result;
- int value = 1;
- int i;
- // Create the thread , passing & value for the argument
- for (i = 0; i < n; i++)
- {
- pthread_create(&thread_ID[i], NULL, thread_function, &value);
- }
- for (i = 0; i < n; i++)
- {
- pthread_join(thread_ID[i], &thread_result);
- }
- int *w[n];
- printf("After initialization W = ");
- for (i = 0; i < n; i++)
- {
- w[i] = (int *)thread_result;
- printf("%d ", *w[i]);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement