I am having problems when I am giving pthread_mutex_attr as parameter during thread form if I NULL < / Strong>, it's working fine, but this does not require a tap,
I'm posting code here, please correct my mistakes and things Help in learning
pthread_mutex_t thread_mutex = PTHREAD_MUTEX_INITIALIZER; Pthread_t thread 1; Pthread_mutexattr_t attr; Pthread_mutexattr_init (& amp; attr); Pthread_mutexattr_setpshared (and enters, PTHREAD_PROCESS_SHARED); Pthread_mutex_init (& thread_mutex, and atri); Ret = pthread_create (and thread 1, faucet, my_function, (zero *) message); Pthread_mutexattr_destroy (& amp; attr); Pthread_mutex_destroy (& thread_mutex); Pthread_exit (zero); If I pass an ATR like this
ret = pthread_create (& thread1, & amp; etr; upload_data; (zero *) message);
This division is making a mistake.
I'm not sure what type of error you get, what exactly is your problem? But I think you can not compile your code.
From man pthread_create : #include & lt; Pthread h & gt; Int pthread_create (pthread_t * thread, const pthread_attr_t * attr, void * (* start_routine) (zero *), zero * arg); Indicates that pthread_create does not use pthread_mutex_attr , but pthread_attr
No comments:
Post a Comment