Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <pthread.h>
- void *rutina(void* param) {
- int p = *((int *) param);
- for(int i = 0; i < 10; i++) {
- printf("%d", i);
- }
- return NULL;
- }
- int main() {
- for(int i = 0; i < 5; i++) {
- pthread_create(&i, NULL, rutina, &i);
- }
- int **ret;
- for(int i = 0; i < 5; i++) {
- pthread_join(i, ret);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement