Explorar el Código

release locks before freeing handle structure. No other thread is supposed to try to take them anyway, as we are freeing the data.

Samuel Thibault hace 13 años
padre
commit
990612ec93
Se han modificado 1 ficheros con 3 adiciones y 0 borrados
  1. 3 0
      src/datawizard/interfaces/data_interface.c

+ 3 - 0
src/datawizard/interfaces/data_interface.c

@@ -520,6 +520,7 @@ static void _starpu_data_unregister(starpu_data_handle_t handle, unsigned cohere
 	_STARPU_PTHREAD_MUTEX_LOCK(&handle->busy_mutex);
 	while (handle->busy_count)
 		_STARPU_PTHREAD_COND_WAIT(&handle->busy_cond, &handle->busy_mutex);
+	_STARPU_PTHREAD_MUTEX_UNLOCK(&handle->busy_mutex);
 
 	/* Wait for finished requests to release the handle */
 	_starpu_spin_lock(&handle->header_lock);
@@ -536,6 +537,8 @@ static void _starpu_data_unregister(starpu_data_handle_t handle, unsigned cohere
 	_starpu_data_requester_list_delete(handle->req_list);
 	_starpu_data_requester_list_delete(handle->reduction_req_list);
 
+	_starpu_spin_unlock(&handle->header_lock);
+
 	free(handle);
 }