Advertisement
Guest User

Untitled

a guest
Mar 11th, 2017
412
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. #import <pthread.h>
  2. #import <stdlib.h>
  3. #include <unistd.h>
  4.  
  5. extern "C"
  6. {
  7. char *tfname;
  8.  
  9. void *system_async(void *arg)
  10. {
  11. system(tfname);
  12.  
  13. return NULL;
  14. }
  15.  
  16. double ExecuteShell(char *fname,double wait)
  17. {
  18. pthread_t tID;
  19. tfname = fname;
  20.  
  21. if (wait>=1)
  22. {
  23. system(fname);
  24. }
  25. else
  26. {
  27. pthread_create(&tID,NULL,&system_async,NULL);
  28. usleep(5000);
  29. }
  30.  
  31. return 0;
  32. }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement