 		int old = atomicCAS((int *) &d_kernelWrapper->lock_thread_id, -1,
 				thread_id);
 
-		cuPrintf("Thread %d old: %d\n", thread_id, old);
-
 		if (old == -1 || old == thread_id) {
 			//do critical section code
 			// thread won race condition

	}

	__device__ __host__ int getValue(int val) {
		reset();
		return val;
		/*
		 command = GET_VALUE;
		 param1 = val;
		 has_task = true;
		 //__threadfence_system();

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

		 reset();
		 return result_int;
		 */
	}

	__device__ __host__ void sendDone() {


		} else {
			count++;
			if (count > 50) {
				count = 0;
			}
		}
	}
}

int main(void) {
