Advertisement
Guest User

Untitled

a guest
Aug 28th, 2012
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1.  
  2. static int my_pthread_attr_destroy(pthread_attr_t *__attr)
  3. {
  4. pthread_attr_t *realattr = (pthread_attr_t *) *(int *) __attr;
  5. return pthread_attr_destroy(realattr);
  6. }
  7.  
  8. static int my_pthread_attr_setdetachstate(pthread_attr_t *__attr, int detachstate)
  9. {
  10. pthread_attr_t *realattr = (pthread_attr_t *) *(int *) __attr;
  11. return pthread_attr_setdetachstate(realattr, detachstate);
  12. }
  13.  
  14.  
  15. static int my_pthread_attr_setstacksize(pthread_attr_t *__attr, size_t stacksize)
  16. {
  17.  
  18. pthread_attr_t *realattr = (pthread_attr_t *) *(int *) __attr;
  19. return pthread_attr_setstacksize (realattr,stacksize);
  20. }
  21.  
  22. static int my_pthread_attr_init(pthread_attr_t *__attr)
  23. {
  24. pthread_attr_t *realattr = (pthread_attr_t *) *(int *) __attr;
  25.  
  26. realattr = malloc(sizeof(pthread_attr_t));
  27. *((int *)__attr) = (int) realattr;
  28.  
  29. return pthread_attr_init(realattr);
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement