Мне нужно запустить два отдельных процесса одновременно. Один просто прослушивает порт X и отправляет данные, когда получает sth, второй выполняет какие-то другие действия.
Я пробовал это:
pthread_t thread1, thread2;
int iret1, iret2;
iret1 = pthread_create( &thread1, NULL, getAddress(), NULL);
iret2 = pthread_create( &thread2, NULL, operate(), (struct IPlist) *IPlist);
В первом я хотел бы запустить get(Address)
- часть прослушивания и отправки, во втором мне нужно запустить operate()
с одним аргументом: *IP list //(struct IPlist *IPlist)
НО, он показывает ошибки:
warning: passing argument 3 of ‘pthread_create’ makes pointer from integer without a cast
/usr/include/pthread.h:225: note: expected ‘void * (*)(void *)’ but argument is of type int
error: incompatible type for argument 4 of ‘pthread_create’
/usr/include/pthread.h:225: note: expected ‘void * __restrict__’ but argument is of type ‘struct IPlist’
Что здесь не так?
Я не очень понимаю руководство, поэтому спрашиваю здесь.
Спасибо за любую помощь !!