 	__device__ __host__ void sendDone() {
 		command = DONE;
 		has_task = true;
-
-		// wait for wrapper thread to accept
-		while (!task_accepted) {
-		}
-
-		printf(
-				"KernelWrapper::sendDone: has_task: %s, task_accepted: %s, lock_thread_id: %d, command: %d\n",
-				(has_task) ? "true" : "false",
-				(task_accepted) ? "true" : "false", lock_thread_id, command);
+		//__threadfence_system();
+
+		//printf(
+		//		"KernelWrapper::sendDone: has_task: %s, lock_thread_id: %d, command: %d\n",
+		//		(has_task) ? "true" : "false", lock_thread_id, command);
 
 		// wait for socket communication to end
 		while (!result_available) {

			(h_kernelWrapper->is_monitoring) ? "true" : "false");

	// test call host_kernelWrapper
	//h_kernelWrapper->active_thread_id = 0;
	//int value = h_kernelWrapper->getValue(0);
	//printf("Host h_kernelWrapper getValue: %d\n", value);

	KernelWrapper *d_kernelWrapper;
	checkCuda(cudaHostGetDevicePointer(&d_kernelWrapper, h_kernelWrapper, 0));

		while (!_this->done) {
			_this->is_monitoring = true;
			//printf(
			//		"KernelWrapper MonitorThread has_task: %s, lock_thread_id: %d, command: %d\n",
			//		(_this->has_task) ? "true" : "false", _this->lock_thread_id,
			//		_this->command);

			if ((_this->has_task) && (_this->lock_thread_id >= 0)
					&& (_this->command != UNDEFINED)) {
				_this->has_task = false;
				_this->sendCommand();
			}
		}
