Explorar o 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 %!s(int64=13) %!d(string=hai) anos
pai
achega
990612ec93
Modificáronse 1 ficheiros con 3 adicións e 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);
 }