Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- How to use thread and queue to push and pop data on gSOAP
- char* register_user(char *form){
- fprintf(stderr,"Entering start register_user---");
- int r = 0;
- void *p;
- char *registeruserresponse;
- _Register* rg = malloc(sizeof(_Register));
- rg->userid = malloc(sizeof(uint64_t));
- rg->firstname = malloc(sizeof(char) * 1024);
- rg->lastname = malloc(sizeof(char) * 1024);
- rg->username = malloc(sizeof(char) * 1024);
- rg->password = malloc(sizeof(char) * 1024);
- rg->email = malloc(sizeof(char) * 1024);
- rg->userphone = malloc(sizeof(char) * 1024);
- rg->time = malloc(sizeof(char) * 1024);
- rg = parseregister(form);
- register_insert(rg);
- p=rg;
- pthread_t th_a;
- if ( pthread_create( &th_a, NULL, register_insert, p) ) {
- printf("error creating thread.");
- abort();
- };
- if ( pthread_join ( th_a, NULL ) ) {
- printf("error joining thread.");
- abort();
- }
- int u = *((int*)p);
- register_insert(rg);
- registeruserresponse = loginack(rg->userid);
- free(rg);
- fprintf(stderr,"leaving start register_user---");
- return registeruserresponse;
- }
Add Comment
Please, Sign In to add comment