 	__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) {

	__device__ __host__ void reset() {
		lock_thread_id = -1;
		command = UNDEFINED;
		has_task = false;
		task_accepted = false;
		result_available = false;
	}

	__device__ __host__ int getValue(int val) {

		// wait for wrapper thread to end
		while (has_task) {
		}

		command = GET_VALUE;
		param1 = val;
		has_task = true;
		//__threadfence_system();

		// wait for wrapper thread to accept
		while (!task_accepted) {
		}

		// wait for socket communication to end
		while (!result_available) {
		}


		is_monitoring = false;
		done = false;
		has_task = false,
		//pthread_mutex_init(&mutex_has_task, NULL);

		reset();
