Advertisement
Guest User

sample

a guest
Mar 31st, 2015
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.33 KB | None | 0 0
  1. //Send Client Request to Server
  2. void *send_server_request( void *msg_to_snd) //where msg_to_snd is a struct
  3. {
  4. pthread_mutex_lock(&mutex1); //only one client can send a request at a time
  5.  
  6. struct msgbuf *ms = (struct msgbuf *)msg_to_snd;
  7. msgsnd (msqid, &ms, sizeof(struct msgbuf) - sizeof(long), 0);
  8.  
  9. pthread_mutex_unlock(&mutex1);
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement