@@ -32,10 +32,10 @@ rust_thread::start() {
32
32
thread = CreateThread (NULL , stack_sz, rust_thread_start, this , 0 , NULL );
33
33
#else
34
34
pthread_attr_t attr;
35
- pthread_attr_init (&attr);
36
- pthread_attr_setstacksize (&attr, stack_sz);
37
- pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_JOINABLE);
38
- pthread_create (&thread, &attr, rust_thread_start, (void *) this );
35
+ CHECKED ( pthread_attr_init (&attr) );
36
+ CHECKED ( pthread_attr_setstacksize (&attr, stack_sz) );
37
+ CHECKED ( pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_JOINABLE) );
38
+ CHECKED ( pthread_create (&thread, &attr, rust_thread_start, (void *) this ) );
39
39
#endif
40
40
}
41
41
@@ -46,7 +46,7 @@ rust_thread::join() {
46
46
WaitForSingleObject (thread, INFINITE);
47
47
#else
48
48
if (thread)
49
- pthread_join (thread, NULL );
49
+ CHECKED ( pthread_join (thread, NULL ) );
50
50
#endif
51
51
thread = 0 ;
52
52
}
@@ -56,6 +56,6 @@ rust_thread::detach() {
56
56
#if !defined(__WIN32__)
57
57
// Don't leak pthread resources.
58
58
// http://crosstantine.blogspot.com/2010/01/pthreadcreate-memory-leak.html
59
- pthread_detach (thread);
59
+ CHECKED ( pthread_detach (thread) );
60
60
#endif
61
61
}
0 commit comments