Revision: 2301
Author:
regra...@gmail.com
Date: Thu Apr 23 16:59:23 2015 UTC
Log: Ensure that pthreads really are cancelled when requested by
adding in a pthread_join when progress thread is stopped
* Thanks to Tony P. from ANL for the bug report/fix
https://code.google.com/p/portals4/source/detail?r=2301
Modified:
/trunk/src/ib/ptl_recv.c
=======================================
--- /trunk/src/ib/ptl_recv.c Thu Jan 29 23:46:15 2015 UTC
+++ /trunk/src/ib/ptl_recv.c Thu Apr 23 16:59:23 2015 UTC
@@ -1076,9 +1076,12 @@
void stop_progress_thread(ni_t *ni)
{
if (ni->has_catcher) {
+ int *status;
ni->catcher_stop = 1;
pthread_cancel(ni->catcher);
ni->has_catcher = 0;
+ pthread_join(ni->catcher, (void **)&status);
+ assert(status == 0 || status == PTHREAD_CANCELED);
}
}