| 834 | } |
| 835 | |
| 836 | static int pthread_join(pthread_t t, void **res) |
| 837 | { |
| 838 | struct _pthread_v *tv = t; |
| 839 | |
| 840 | pthread_testcancel(); |
| 841 | |
| 842 | WaitForSingleObject(tv->h, INFINITE); |
| 843 | CloseHandle(tv->h); |
| 844 | |
| 845 | /* Obtain return value */ |
| 846 | if (res) *res = tv->ret_arg; |
| 847 | |
| 848 | free(tv); |
| 849 | |
| 850 | return 0; |
| 851 | } |
| 852 | |
| 853 | static int pthread_detach(pthread_t t) |
| 854 | { |